-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TopBar Widget keeps being visible after Keyboard hides and modal shrinks again #96
Comments
Can you please share the recording? It is hard for me to figure out what the actual problem is. Thanks! |
@ulusoyca Sure, here is a recording. As you can see the topBar title is not disappearing when the keyboard hides. rpreplay-final1699955352_NJJ59X9w.mp4 |
Any idea or feedback? |
@kamami Thanks for your recording. @MbIXjkee is starting a revamp of the internals of the modal sheet that will most probably address this issue. We are also observing sämilar behavior when there is focus change. We will revisit this issue once we do some internal structure refactoring. I am very sorry for the delay, but hopefully in the end we will have a great package! |
Just FYI: This issue still persists in v0.2.0. - I just upgraded and testet it. |
@kamami I am working on a fix for this. Meanwhile, can you do this:
WHYWhen the text field gains focus, the page is scrolled due to push from the soft keyboard. However, when it loses the focus, it doesn't scroll back in the reverse direction. |
@kamami I checked this workaround and it works: final ScrollController scrollController = ScrollController();
final keyboardVisibilityNotifier = ValueNotifier<bool?>(null);
keyboardVisibilityNotifier.addListener(() {
if (keyboardVisibilityNotifier.value == false) {
scrollController.position.animateTo(
0,
duration: const Duration(milliseconds: 300),
curve: Curves.easeOut,
);
}
});
return WoltModalSheetPage(
scrollController: scrollController,
stickyActionBar: KeyboardVisibilityBuilder(
builder: (_ , bool isKeyboardVisible) {
keyboardVisibilityNotifier.value = isKeyboardVisible;
... |
I will work on this later the day. Will give it a try and provide feedback here! Thanks |
I just gave it a try and switched to the suggested branch and installed flutter_keybord_visibility. Unfortunately it did not fix the issue. Did I miss anything? Here ist my Code:
|
I just pushed another change. It should work now 🙏🏻 Here is my recording:
|
Ok, my final push has even a better solution. The previous recording was scrolling to the top all the time even for long content. My final solution will repaint after closing the keyboard, so we won't need to scroll to top all the time. This took quite a while to find out the root cause. Thanks for bearing with me.
|
What changes in the code need to be done to make the latest push working? Do I still need to add flutter_keybord_visibility? |
You only need to get the branch and provide keyboard visibility notifier as you did in previous. The rest should work. I am hoping to remove the dependency to the keyboard visibility notifier also in the branch but it will be after holidays. |
Awesome! |
Merged #119 |
@kamami We released 0.3.0 with this fix. |
I have a TextField in my modal. When unfocusing it, the topBar Widget is still visible and I can not scroll the sheet to make it disappear.
The text was updated successfully, but these errors were encountered: