File tree Expand file tree Collapse file tree
app/src/main/java/org/schabi/newpipe/fragments/detail Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2208,12 +2208,20 @@ private void moveFocusToMainFragment(final boolean toMain) {
22082208 mainFragment .setDescendantFocusability (afterDescendants );
22092209 toolbar .setDescendantFocusability (afterDescendants );
22102210 ((ViewGroup ) requireView ()).setDescendantFocusability (blockDescendants );
2211- mainFragment .requestFocus ();
2211+ // Only focus the mainFragment if the mainFragment (e.g. search-results)
2212+ // or the toolbar (e.g. Textfield for search) don't have focus.
2213+ // This was done to fix problems with the keyboard input, see also #7490
2214+ if (!mainFragment .hasFocus () && !toolbar .hasFocus ()) {
2215+ mainFragment .requestFocus ();
2216+ }
22122217 } else {
22132218 mainFragment .setDescendantFocusability (blockDescendants );
22142219 toolbar .setDescendantFocusability (blockDescendants );
22152220 ((ViewGroup ) requireView ()).setDescendantFocusability (afterDescendants );
2216- binding .detailThumbnailRootLayout .requestFocus ();
2221+ // Only focus the player if it not already has focus
2222+ if (!binding .getRoot ().hasFocus ()) {
2223+ binding .detailThumbnailRootLayout .requestFocus ();
2224+ }
22172225 }
22182226 }
22192227
You can’t perform that action at this time.
0 commit comments