-
Notifications
You must be signed in to change notification settings - Fork 6k
[Web] Fix an assertion error due to synthesized keyboard events #49087
[Web] Fix an assertion error due to synthesized keyboard events #49087
Conversation
a1a6c54 to
942a74a
Compare
| type: ui.KeyEventType.up, | ||
| physical: physicalKey, | ||
| logical: logicalKey(), | ||
| logical: _pressingRecords[physicalKey]!, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution @bleroux!
@dkwingsmt is this an acceptable approach to handling the hardware_keyboard physical/logical key mismatch error on web? From my understanding, the code here is written to map logical keys on web similar to how other platforms do it - however, I think only the browser emits extra "Process" key events for special characters like IME composition, emojis, etc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think so. Actually I wonder why I didn't do it in the first place. Since the up event should always have the same logical key as the down event, this looks very idiomatic.
|
Thank you for the fix! This is definitely an edge case I didn't think about before. |
htoor3
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you again @bleroux
…142071) flutter/engine@57d6b51...11a16d8 2024-01-23 [email protected] [Web] Fix an assertion error due to synthesized keyboard events (flutter/engine#49087) 2024-01-23 [email protected] [Windows] Introduce egl::Context (flutter/engine#49954) 2024-01-23 [email protected] Roll Fuchsia Linux SDK from uQK4l0QeH_PlZO6cF... to kYC2-fFgjbb36mukB... (flutter/engine#49976) 2024-01-23 [email protected] Roll Skia from 58973cca0edd to 59a70a1efc39 (17 revisions) (flutter/engine#49975) Also rolling transitive DEPS: fuchsia/sdk/core/linux-amd64 from uQK4l0QeH_Pl to kYC2-fFgjbb3 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://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Description
On Web, browsers can emit key events with a logical key sets to
Processduring composition.It is usually not a problem, but in some edge cases (for instance when the browser window lost focus and some keys events were missed), the Flutter web engine might synthesize an up event with a logical key value different that the one used for the down event and this will lead to an assertion message on the framework side.
Related Issue
Fixes flutter/flutter#126247.
Tests
Adds 1 test.