Skip to content
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

Let iOS keyboard dismissal synchronize with scroll #57609

Open
xster opened this issue May 19, 2020 · 29 comments
Open

Let iOS keyboard dismissal synchronize with scroll #57609

xster opened this issue May 19, 2020 · 29 comments
Assignees
Labels
a: fidelity Matching the OEM platforms better a: text input Entering text in a text field or keyboard related problems c: new feature Nothing broken; request for a new capability c: proposal A detailed proposal for a change to Flutter customer: crowd Affects or could affect many people, though not necessarily a specific customer. engine flutter/engine repository. See also e: labels. f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels. P3 Issues that are less important to the Flutter project platform-ios iOS applications specifically team-ios Owned by iOS platform team triaged-ios Triaged by iOS platform team

Comments

@xster
Copy link
Member

xster commented May 19, 2020

Since #21814, keyboards will dismiss during scroll. For higher fidelity, rather than one single brisk dismissal event, the keyboard dismissal should ideally be done gradually along with the scroll gesture.

Android counterpart: #62876

@xster xster added a: text input Entering text in a text field or keyboard related problems platform-ios iOS applications specifically framework flutter/packages/flutter repository. See also f: labels. engine flutter/engine repository. See also e: labels. a: fidelity Matching the OEM platforms better f: scrolling Viewports, list views, slivers, etc. labels May 19, 2020
@xster
Copy link
Member Author

xster commented Aug 27, 2020

The upstream visual symptom to fix is #19279

@TahaTesser TahaTesser added passed first triage c: proposal A detailed proposal for a change to Flutter labels Sep 1, 2020
@xster xster added this to Engineer Reviewed in Mobile - iOS fidelity review Nov 12, 2020
@kf6gpe kf6gpe added the P3 Issues that are less important to the Flutter project label Dec 10, 2020
@jmagman jmagman added this to Awaiting triage in iOS Platforms - text review Jun 8, 2021
@mleonhard
Copy link
Contributor

I still need this.

@furkansarihan
Copy link

@mleonhard
Copy link
Contributor

Dear Google Flutter Team,
I am preparing an app for release on Android & iOS. It has a small chat function. I am struggling to get the UX to match expectations for iOS users.

A common use-case for chat functions is to scroll up and consult a previous message while composing a new message. Users expect this on all platforms. Flutter currently makes this very hard to implement with acceptable UX on iOS:

  • A Flutter app using the onDrag mode will hide the keyboard as soon as the user begins scrolling. This is jarring to iOS users who expect the keyboard to stay put.
    • If the app displays messages with a ListView with reverse: true, when the keyboard hides, the list jumps down. This is jarring, too. The user scrolls the desired information into view and taps the text box. The keyboard re-appears and the list jumps upward again, hiding the information they wanted to see. The user must learn to scroll the information to the bottom edge of the screen before tapping the text box. If they don't use the app frequently, they will forgot to do this and feel frustrated every time they use the Flutter app.
    • If the app displays messages with a non-reversed ListView, the app must scroll the list up to the proper position when the keyboard appears. Figuring out how to do this is incredibly involved and may be impossible. Also, when the user begins scrolling and the keyboard disappears, they are left with the list scrolled half-way up the screen. They must move their finger down half the screen to continue scrolling. Additionally, when the user is scrolling and a new message arrives, the app tries to scroll to the bottom. This cancels their current scroll gesture. This is jarring. Therefore the non-reversed ListView requires large amounts of code to work around Flutter's poor behavior when scrolling and showing/hiding the keyboard.
  • A Flutter app could configure the keyboard with a done button by passing TextInputAction. This means the app cannot use the newline or send buttons which are much more useful.
  • The third-party module flutter_interactive_keyboard provides the function requested in this issue. It is at v0.2.0. It has no tests. Every team desiring to use this in their production apps will need to review the code thoroughly.
  • The third-party module keyboard_actions provides buttons that appear above the keyboard to dismiss it. Some iOS apps use this mode. The row takes up vertical space on the screen. This makes the app harder to use on small phones and for folks who can't see very well and have their device zoomed or set to display large fonts. The module has no tests. Every team desiring to use this in their production apps will need to review the code thoroughly.

Would you please implement this now?

Best Wishes,
Michael

CC: Flutter PM Tim Sneath @timsneath

@CavalcanteLeo
Copy link

CavalcanteLeo commented Nov 1, 2021

Seems flutter want to remove all smoothness of the iOS, or they really don't care about iOS.
A lot of shader jank, weird keyboard behavior.

@Tom3652
Copy link

Tom3652 commented Dec 3, 2021

i am in the same situation as you @mleonhard, and as an iOS user myself i can tell that this is simply required as UX experience... Hopefully the upvotes should give some weight to the request as it is impacted many people :/

@darshankawar darshankawar added customer: crowd Affects or could affect many people, though not necessarily a specific customer. c: new feature Nothing broken; request for a new capability labels Jan 4, 2022
@Kiruel
Copy link

Kiruel commented Nov 17, 2022

Can I help for this issue ?
Because the flutter_interactive_keyboard seams no to work anymore, so we don't have any workaround. And this library use a fake view to perform the trick. We should have the native interactive keyboard from iOS.

There is a way in iOS Swift to scroll the keyboard with a custom offset ?

@CavalcanteLeo
Copy link

I have abandoned Flutter because of this, not quite close to iOS experience

@hellohuanlin
Copy link
Contributor

AFAIK there isn't an API to explicitly set the keyboard frames on iOS.

Though the workaround described here (a separate but maybe related issue) may worth investigation.

@mleonhard
Copy link
Contributor

I have abandoned Flutter because of this, not quite close to iOS experience

I also abandoned Flutter because of this and many other problems in Flutter. There has been almost no progress on any of these issues in 2 years. I guess Google Flutter Team has moved on to Desktop Flutter and silently abandoned Mobile Flutter, leaving Flutter for iOS at pre-release quality. 😭

@CavalcanteLeo
Copy link

CavalcanteLeo commented Nov 30, 2022

I have abandoned Flutter because of this, not quite close to iOS experience

I also abandoned Flutter because of this and many other problems in Flutter. There has been almost no progress on any of these issues in 2 years. I guess Google Flutter Team has moved on to Desktop Flutter and silently abandoned Mobile Flutter, leaving Flutter for iOS at pre-release quality. 😭

And the worst of all: shader jank

Flutter on iOS has a quite bad experience, good for early stage startup where they are validating the mvp with less effort

@CavalcanteLeo
Copy link

The year 2023 and Flutter still have a UX gap from native iOS apps. I know a few companies that don't use Flutter because of this “small” problem. 6 years of flutter and still not having it. This should be P1

@hellohuanlin
Copy link
Contributor

@CavalcanteLeo Hello, @Matt2D is now working on this

auto-submit bot pushed a commit to flutter/engine that referenced this issue Aug 4, 2023
…Movement (#43972)

This PR address the movement aspect of the flutter interactive keyboard. It handles pointer movement while a scroll view widget is visible, and the interactive behavior is chosen for keyboardDismissBehavior. This is a desired behavior of the keyboard that has not yet been implemented. 
Design Document:
https://docs.google.com/document/d/1-T7_0mSkXzPaWxveeypIzzzAdyo-EEuP5V84161foL4/edit?pli=1

Issues Address:
flutter/flutter#57609

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
auto-submit bot pushed a commit to flutter/engine that referenced this issue Aug 8, 2023
This PR address the movement aspect of the flutter interactive keyboard. It handles pointer up while a scroll view widget is visible, and the interactive behavior is chosen for keyboardDismissBehavior. This is a desired behavior of the keyboard that has not yet been implemented.
Design Document:
https://docs.google.com/document/d/1-T7_0mSkXzPaWxveeypIzzzAdyo-EEuP5V84161foL4/edit?pli=1

Issues Address:
flutter/flutter#57609

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
auto-submit bot pushed a commit to flutter/engine that referenced this issue Aug 9, 2023
This PR addresses an issue with the animation of the keyboard. In iOS 16.0 a delay was included in UIView becomeFirstResponder where the areAnimationsEnabled boolean is no longer immediately read. In response to this issue a delay is added that allows for the animation to be properly disabled. 

Design Document:
https://docs.google.com/document/d/1-T7_0mSkXzPaWxveeypIzzzAdyo-EEuP5V84161foL4/edit?pli=1

Issues Address:
flutter/flutter#57609

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
auto-submit bot pushed a commit to flutter/engine that referenced this issue Aug 10, 2023
This PR addresses an issue with the behavior of the keyboard. Originally the behavior of the keyboard was to see if the pointer was above or below the middle of the keyboards full size and then animate appropriately. However we found that the behavior is instead based on velocity. This PR adjust the code to match this behavior.

Design Document:
https://docs.google.com/document/d/1-T7_0mSkXzPaWxveeypIzzzAdyo-EEuP5V84161foL4/edit?pli=1

Issues Address:
flutter/flutter#57609

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
gaaclarke pushed a commit to gaaclarke/engine that referenced this issue Aug 30, 2023
…Movement (flutter#43972)

This PR address the movement aspect of the flutter interactive keyboard. It handles pointer movement while a scroll view widget is visible, and the interactive behavior is chosen for keyboardDismissBehavior. This is a desired behavior of the keyboard that has not yet been implemented. 
Design Document:
https://docs.google.com/document/d/1-T7_0mSkXzPaWxveeypIzzzAdyo-EEuP5V84161foL4/edit?pli=1

Issues Address:
flutter/flutter#57609

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
gaaclarke pushed a commit to gaaclarke/engine that referenced this issue Aug 30, 2023
This PR address the movement aspect of the flutter interactive keyboard. It handles pointer up while a scroll view widget is visible, and the interactive behavior is chosen for keyboardDismissBehavior. This is a desired behavior of the keyboard that has not yet been implemented.
Design Document:
https://docs.google.com/document/d/1-T7_0mSkXzPaWxveeypIzzzAdyo-EEuP5V84161foL4/edit?pli=1

Issues Address:
flutter/flutter#57609

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
gaaclarke pushed a commit to gaaclarke/engine that referenced this issue Aug 30, 2023
This PR addresses an issue with the animation of the keyboard. In iOS 16.0 a delay was included in UIView becomeFirstResponder where the areAnimationsEnabled boolean is no longer immediately read. In response to this issue a delay is added that allows for the animation to be properly disabled. 

Design Document:
https://docs.google.com/document/d/1-T7_0mSkXzPaWxveeypIzzzAdyo-EEuP5V84161foL4/edit?pli=1

Issues Address:
flutter/flutter#57609

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
gaaclarke pushed a commit to gaaclarke/engine that referenced this issue Aug 30, 2023
This PR addresses an issue with the behavior of the keyboard. Originally the behavior of the keyboard was to see if the pointer was above or below the middle of the keyboards full size and then animate appropriately. However we found that the behavior is instead based on velocity. This PR adjust the code to match this behavior.

Design Document:
https://docs.google.com/document/d/1-T7_0mSkXzPaWxveeypIzzzAdyo-EEuP5V84161foL4/edit?pli=1

Issues Address:
flutter/flutter#57609

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
@ky1vstar
Copy link

ky1vstar commented Oct 9, 2023

While we are waiting for this to be resolved, you can check my plugin which tends to close this gap.
Also, it has input accessory handling like in native apps.

@abdalmonem
Copy link

@ky1vstar
Amazing 🥳 , am going to implement it tomorrow and gave you my feedback

@abdalmonem
Copy link

Thanks @ky1vstar, Works like a charm 💯
For all, you can use ky1vstar plugin until flutter official implements IOS keyboard scroll behavior.
@Matt2D I know you working on this, and i have read your solution Hypotheses docs tow months ago, i found this plugin really impressive and maybe gave some inspiration push toward the final solid solution.

@subins829

This comment was marked as off-topic.

@flutter-triage-bot flutter-triage-bot bot added the Bot is counting down the days until it unassigns the issue label Dec 4, 2023
@flutter-triage-bot
Copy link

This issue is assigned to @Matt2D but has had no recent status updates. Please consider unassigning this issue if it is not going to be addressed in the near future. This allows people to have a clearer picture of what work is actually planned. Thanks!

@cbracken
Copy link
Member

cbracken commented Dec 7, 2023

@subins829 this issue is specific to iOS behaviour. It looks like your comment refers to Android specific behaviour, which is tracked in #62876. Would you mind replying on that issue?

@cbracken
Copy link
Member

cbracken commented Dec 7, 2023

The bulk of this work for iOS landed in flutter/engine#43972, flutter/engine#44457, flutter/engine#44586, and dismiss on scroll should now be working on iOS, along with flick up/down gestures that either completely dismiss/restore the keyboard partway through a scroll.

@hellohuanlin the main feature here was landed by @Matt2D, if there are any remaining items to close this, we should precisely lay them out here.

@hellohuanlin
Copy link
Contributor

@cbracken The screenshot approach doesn't work on iOS 17 anymore since the keyboard is running out of process. We have to find another approach for iOS 17. Let's keep this open for now.

@flutter-triage-bot flutter-triage-bot bot removed the Bot is counting down the days until it unassigns the issue label Dec 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: fidelity Matching the OEM platforms better a: text input Entering text in a text field or keyboard related problems c: new feature Nothing broken; request for a new capability c: proposal A detailed proposal for a change to Flutter customer: crowd Affects or could affect many people, though not necessarily a specific customer. engine flutter/engine repository. See also e: labels. f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels. P3 Issues that are less important to the Flutter project platform-ios iOS applications specifically team-ios Owned by iOS platform team triaged-ios Triaged by iOS platform team
Projects
Mobile - iOS fidelity review
  
Engineer Reviewed
iOS Platforms - text review
  
Awaiting triage
Development

No branches or pull requests