mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: lose focus when changing tabs (#6118)
This commit is contained in:
parent
47c2ae23ed
commit
78c2e756d6
@ -1,6 +1,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:appflowy/workspace/application/tabs/tabs_bloc.dart';
|
import 'package:appflowy/workspace/application/tabs/tabs_bloc.dart';
|
||||||
|
import 'package:appflowy/workspace/presentation/home/af_focus_manager.dart';
|
||||||
import 'package:appflowy/workspace/presentation/home/home_sizes.dart';
|
import 'package:appflowy/workspace/presentation/home/home_sizes.dart';
|
||||||
import 'package:appflowy/workspace/presentation/home/tabs/flowy_tab.dart';
|
import 'package:appflowy/workspace/presentation/home/tabs/flowy_tab.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
@ -74,8 +75,10 @@ class _TabsManagerState extends State<TabsManager>
|
|||||||
dividerColor: Colors.transparent,
|
dividerColor: Colors.transparent,
|
||||||
isScrollable: true,
|
isScrollable: true,
|
||||||
controller: _controller,
|
controller: _controller,
|
||||||
onTap: (newIndex) =>
|
onTap: (newIndex) {
|
||||||
context.read<TabsBloc>().add(TabsEvent.selectTab(newIndex)),
|
AFFocusManager.of(context).notifyLoseFocus();
|
||||||
|
context.read<TabsBloc>().add(TabsEvent.selectTab(newIndex));
|
||||||
|
},
|
||||||
tabs: state.pageManagers
|
tabs: state.pageManagers
|
||||||
.map(
|
.map(
|
||||||
(pm) => FlowyTab(
|
(pm) => FlowyTab(
|
||||||
|
Loading…
Reference in New Issue
Block a user