Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@Matt2D
Copy link
Contributor

@Matt2D Matt2D commented 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

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See testing the engine for instructions on writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@Matt2D Matt2D marked this pull request as ready for review August 10, 2023 15:47
Copy link
Contributor

@hellohuanlin hellohuanlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some nits

[self showKeyboardAndRemoveScreenshot];
if (_keyboardView.superview != nil) {
// Done to avoid the issue of a pointer up done without a screenshot
// View must be loaded at this point.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: space

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

CGFloat keyboardHeight = _keyboardRect.size.height;
// Negative velocity indicates a downward movement
BOOL shouldDismissKeyboardBasedOnVelocity = _pointerYVelocity < 0;
[UIView animateWithDuration:0.3f
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you make it a constant at the top of file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely, added a description as well.

} else {
[self setKeyboardContainerHeight:pointerY];
_pointerYVelocity = _previousPointerYPosition - pointerY;
NSLog(@"%f", _pointerYVelocity);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slipped by me. Will remove right away!

@hellohuanlin hellohuanlin added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 10, 2023
@auto-submit auto-submit bot merged commit a9be77e into flutter:main Aug 10, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 10, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Aug 10, 2023
…132328)

flutter/engine@ea7730c...a9be77e

2023-08-10 [email protected] Flutter iOS Interactive Keyboard: Fixing Behavior Issue  (flutter/engine#44586)
2023-08-10 [email protected] [Impeller] Flutter GPU: Add context override. (flutter/engine#44566)
2023-08-10 [email protected] [Impeller] External OpenGLES texture sampling. (flutter/engine#44559)
2023-08-10 [email protected] Roll Fuchsia Linux SDK from 961_tJawsbLMdy5i0... to konJQZKk2qXc276iA... (flutter/engine#44593)
2023-08-10 [email protected] Roll Skia from 364900538771 to 92e6f52b0fa8 (1 revision) (flutter/engine#44592)
2023-08-10 [email protected] Roll Skia from f39fd2de8f10 to 364900538771 (1 revision) (flutter/engine#44590)

Also rolling transitive DEPS:
  fuchsia/sdk/core/linux-amd64 from 961_tJawsbLM to konJQZKk2qXc

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
gaaclarke pushed a commit to gaaclarke/engine that referenced this pull request 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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App platform-ios

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants