mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
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:
parent
a91bb399f0
commit
081307ced2
2 changed files with 35 additions and 5 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue