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

Conversation

@knopp
Copy link
Member

@knopp knopp commented Sep 19, 2023

Fixes flutter/flutter#134906
Fixes flutter/flutter#133832

This ensures that there are only two first responder widgets - FlutterView when text input is not active and TextInputPlugin when text input is active. The PR also prevents FlutterView stealing first responder status on mouse click events during text input.

Previously when TextInputClient resigned it made nextResponder the first responder, but that was incorrect - nextResponder being the superview (FlutterViewWrapper).

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 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.

@knopp knopp changed the title [macOS] Ensure first responder is consistent during text input [macOS] Ensure first responder is consistent during and after text input Sep 19, 2023
@knopp knopp force-pushed the 134906_fix_first_responder branch from 54abb60 to f89c511 Compare September 19, 2023 12:40
@knopp knopp requested a review from cbracken September 20, 2023 11:15
@knopp knopp force-pushed the 134906_fix_first_responder branch from f89c511 to 9d8230f Compare September 28, 2023 20:46
Copy link
Member

@cbracken cbracken left a comment

Choose a reason for hiding this comment

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

lgtm!

@knopp knopp force-pushed the 134906_fix_first_responder branch from 58f7c99 to 0941b82 Compare September 29, 2023 07:27
@knopp knopp merged commit 8b4e633 into flutter:main Sep 29, 2023
@knopp knopp deleted the 134906_fix_first_responder branch September 29, 2023 09:02
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 29, 2023
harryterkelsen pushed a commit that referenced this pull request Oct 23, 2023
…put (#46032)

Fixes flutter/flutter#134906
Fixes flutter/flutter#133832

This ensures that there are only two first responder widgets -
`FlutterView` when text input is not active and `TextInputPlugin` when
text input is active. The PR also prevents `FlutterView` stealing first
responder status on mouse click events during text input.

Previously when `TextInputClient` resigned it made `nextResponder` the
first responder, but that was incorrect - `nextResponder` being the
superview (`FlutterViewWrapper`).

## Pre-launch Checklist

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

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

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[macOS] First responder is sometimes wrong Unable to move focus with shortcuts.

2 participants