mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
[web] Fix Altgr keyboard crash (#21781)
* Fix AltGr modifier crash * update integration test
This commit is contained in:
parent
30bad27f53
commit
d5c5a8ec61
@ -179,6 +179,21 @@ void main() {
|
||||
'cancelable': true,
|
||||
});
|
||||
|
||||
// Press and release AltGr key.
|
||||
// Regression test for https://github.com/flutter/flutter/issues/58979.
|
||||
dispatchKeyboardEvent(input, 'keydown', <String, dynamic>{
|
||||
'key': 'AltGraph',
|
||||
'code': 'AltRight',
|
||||
'bubbles': true,
|
||||
'cancelable': true,
|
||||
});
|
||||
dispatchKeyboardEvent(input, 'keyup', <String, dynamic>{
|
||||
'key': 'AltGraph',
|
||||
'code': 'AltRight',
|
||||
'bubbles': true,
|
||||
'cancelable': true,
|
||||
});
|
||||
|
||||
// Press Tab. The focus should move to the next TextFormField.
|
||||
dispatchKeyboardEvent(input, 'keydown', <String, dynamic>{
|
||||
'key': 'Tab',
|
||||
|
||||
@ -177,7 +177,7 @@ int _getMetaState(html.KeyboardEvent event) {
|
||||
if (event.getModifierState('Shift')) {
|
||||
metaState |= _modifierShift;
|
||||
}
|
||||
if (event.getModifierState('Alt')) {
|
||||
if (event.getModifierState('Alt') || event.getModifierState('AltGraph')) {
|
||||
metaState |= _modifierAlt;
|
||||
}
|
||||
if (event.getModifierState('Control')) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user