fix: expand sheet when album search is focused (#20651)

* fix: expand sheet when album search is focused

* convert GeneralBottomSheet to ConsumerStatefulWidget

* fix: cleaning up

---------

Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
Brandon Wees 2025-08-04 20:35:57 -05:00 committed by GitHub
parent a91bb399f0
commit 081307ced2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 35 additions and 5 deletions

View file

@ -27,8 +27,9 @@ typedef AlbumSelectorCallback = void Function(RemoteAlbum album);
class AlbumSelector extends ConsumerStatefulWidget {
final AlbumSelectorCallback onAlbumSelected;
final Function? onKeyboardExpanded;
const AlbumSelector({super.key, required this.onAlbumSelected});
const AlbumSelector({super.key, required this.onAlbumSelected, this.onKeyboardExpanded});
@override
ConsumerState<AlbumSelector> createState() => _AlbumSelectorState();
@ -52,6 +53,12 @@ class _AlbumSelectorState extends ConsumerState<AlbumSelector> {
searchController.addListener(() {
onSearch(searchController.text, filterMode);
});
searchFocusNode.addListener(() {
if (searchFocusNode.hasFocus) {
widget.onKeyboardExpanded?.call();
}
});
}
void onSearch(String searchTerm, QuickFilterMode sortMode) {