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

Conversation

@gspencergoog
Copy link
Contributor

Description

This implements the "Delayed event delivery" that I've implemented for the other platforms.

Because they require synchronous responses, other platforms need to re-dispatch events that weren't handled by the framework once it responds, but the web just needs to call preventDefault on the events that the framework handles, since it all happens in the same thread anyhow.

Related Issues

Tests

  • Added tests to check that events handled by the framework have preventDefault called on them (and vice versa).

Breaking Change

  • No, no existing tests failed, so this is not a breaking change.

@google-cla google-cla bot added the cla: yes label Jan 13, 2021
@gspencergoog gspencergoog changed the title Implement handling of framework-handled key combinations Implement handling of framework-handled key events Jan 13, 2021
Comment on lines 130 to 140
_messageCodec.encodeMessage(eventData), (ByteData? data) {
if (data == null) {
return;
}
final String response = utf8.decode(data.buffer.asUint8List());
final Map<String, dynamic> jsonResponse = json.decode(response);
if (jsonResponse['handled'] as bool) {
// If the framework handled it, then don't propagate it any further.
event.preventDefault();
}
},
);
Copy link
Contributor

Choose a reason for hiding this comment

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

FYI this file is being heavily refactored in #23466.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I'm quite aware (and Tong knows I'm working on this).

@gspencergoog gspencergoog force-pushed the web_delayed_keys branch 2 times, most recently from c78e68c to 03dfc7c Compare January 13, 2021 22:48
@gspencergoog gspencergoog marked this pull request as ready for review January 14, 2021 20:36
@gspencergoog
Copy link
Contributor Author

@mdebbar OK, this is ready for review, if you have the time.

@gspencergoog gspencergoog force-pushed the web_delayed_keys branch 2 times, most recently from 80fdf5b to 17927b9 Compare January 14, 2021 23:28
@gspencergoog gspencergoog added the waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land. label Jan 19, 2021
@fluttergithubbot fluttergithubbot merged commit df5f3b0 into flutter:master Jan 20, 2021
gspencergoog added a commit to gspencergoog/engine that referenced this pull request Jan 20, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 20, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 20, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 20, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 20, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 20, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 20, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 20, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 20, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 20, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 20, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 20, 2021
zanderso pushed a commit to flutter/flutter that referenced this pull request Jan 20, 2021
* d4a7358 Roll Dart SDK from c4214e6daaac to 4a6764bf28c2 (4 revisions) (flutter/engine#23770)

* 9bc776a [web] Add --watch flag to 'felt test' (flutter/engine#23727)

* 247ebc2 Roll Skia from bde06cc511d2 to f3087d8297fe (7 revisions) (flutter/engine#23772)

* 8b27e6f skip flaky test (flutter/engine#23775)

* 2927e9f block thread merging with shared engines (flutter/engine#23733)

* df5f3b0 Implement handling of framework-handled key events (flutter/engine#23655)

* f205ced Roll Skia from f3087d8297fe to e0fe62adaa3e (9 revisions) (flutter/engine#23781)

* fa7aebf Roll Skia from e0fe62adaa3e to 18aeb5731b51 (1 revision) (flutter/engine#23784)

* 9acfb7d Fix JNI void vs object method call (flutter/engine#23785)

* df13ccf Roll Skia from 18aeb5731b51 to 7aa7f039b9ee (1 revision) (flutter/engine#23786)

* e3e3b2b Roll Fuchsia Mac SDK from pc_veLlry... to xYraItnQp... (flutter/engine#23787)

* 8a096d6 ci: Print output in case of compile error (flutter/engine#23522)

* f1c3ced Roll Fuchsia Linux SDK from fByXAJ76e... to vs54lOVoj... (flutter/engine#23788)

* 0c79393 Revert "Roll Dart SDK from c4214e6daaac to 4a6764bf28c2 (4 revisions) (#23770)" (flutter/engine#23791)
hjfreyer pushed a commit to hjfreyer/engine that referenced this pull request Mar 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants