From 78c2e756d6db046da1b4f0dbceccd6ebac225644 Mon Sep 17 00:00:00 2001 From: Mathias Mogensen <42929161+Xazin@users.noreply.github.com> Date: Fri, 30 Aug 2024 10:12:36 +0200 Subject: [PATCH] fix: lose focus when changing tabs (#6118) --- .../lib/workspace/presentation/home/tabs/tabs_manager.dart | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/home/tabs/tabs_manager.dart b/frontend/appflowy_flutter/lib/workspace/presentation/home/tabs/tabs_manager.dart index 07870a152d..51f3e0b766 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/home/tabs/tabs_manager.dart +++ b/frontend/appflowy_flutter/lib/workspace/presentation/home/tabs/tabs_manager.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.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/tabs/flowy_tab.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -74,8 +75,10 @@ class _TabsManagerState extends State dividerColor: Colors.transparent, isScrollable: true, controller: _controller, - onTap: (newIndex) => - context.read().add(TabsEvent.selectTab(newIndex)), + onTap: (newIndex) { + AFFocusManager.of(context).notifyLoseFocus(); + context.read().add(TabsEvent.selectTab(newIndex)); + }, tabs: state.pageManagers .map( (pm) => FlowyTab(