Skip to content

Commit

Permalink
Fix unintended keyboard popup when navigating back to main screen fro…
Browse files Browse the repository at this point in the history
…m Search (#1686)

* fix: unintended keyboard popup when navigating to main screen

* chore: minor linting
  • Loading branch information
hjiangsu authored Feb 7, 2025
1 parent 1226979 commit a477b29
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/thunder/widgets/bottom_nav_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@ class _CustomBottomNavigationBarState extends State<CustomBottomNavigationBar> {
context.read<FeedBloc>().add(ScrollToTopEvent());
}

if (widget.selectedPageIndex == 1 && index == 1) {
if (widget.selectedPageIndex == 1 && index != 1) {
FocusManager.instance.primaryFocus?.unfocus();
} else if (widget.selectedPageIndex == 1 && index == 1) {
context.read<SearchBloc>().add(FocusSearchEvent());
}

Expand Down

0 comments on commit a477b29

Please sign in to comment.