这是indexloc提供的服务,不要输入任何密码
Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Prevent default when Tab is clicked #12986

Merged
merged 1 commit into from
Oct 8, 2019
Merged

Conversation

mdebbar
Copy link
Contributor

@mdebbar mdebbar commented Oct 7, 2019

Hitting Tab inside a text field messes up the focus in the browser. We should prevent default and let Flutter handle it.

This PR also fixes a leak of Keyboard initialization across tests.

Issue: flutter/flutter#41396

@mdebbar mdebbar added affects: text input accessibility platform-web Code specifically for the web engine labels Oct 7, 2019
@mdebbar mdebbar requested review from yjbanov and nturgut October 7, 2019 22:48
@mdebbar mdebbar self-assigned this Oct 7, 2019

default:
return false;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Question: I don't know how custom shortcuts work very well. For example if a user/operating system defined a combination of keys as tab (for example F3 also works as tab), will this code still work?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That will depend on how the OS is sending the event to the browser.

My guess is that the OS or the keyboard is doing the mapping and sending a Tab key event to the browser. For example, some keyboards have a Copy and Paste keys. So I attached a keydown event listener in the browser and clicked the Copy key in my keyboard. I got a ctrl then a c.

Copy link
Contributor

@nturgut nturgut left a comment

Choose a reason for hiding this comment

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

Thanks Mouad, I left a question, we can also address it in a next cl if we need to add a check about it.

@mdebbar mdebbar merged commit dbb285d into flutter:master Oct 8, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 8, 2019
engine-flutter-autoroll added a commit to flutter/flutter that referenced this pull request Oct 8, 2019
git@github.com:flutter/engine.git/compare/49dbaae818cd...3a445ed

git log 49dbaae..3a445ed --no-merges --oneline
2019-10-08 30870216+gaaclarke@users.noreply.github.com Made _printDebug only happen on debug builds of the engine for now. (flutter/engine#12980)
2019-10-08 devoncarew@google.com remove references to package:_chrome (flutter/engine#12931)
2019-10-08 ditman@gmail.com Open source canvas tests from flutter_web_ui (flutter/engine#12819)
2019-10-08 mouad.debbar@gmail.com Prevent default when Tab is clicked (flutter/engine#12986)


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 chinmaygarde@google.com on the revert to ensure that a human
is aware of the problem.

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/+/master/autoroll/README.md
Inconnu08 pushed a commit to Inconnu08/flutter that referenced this pull request Nov 26, 2019
git@github.com:flutter/engine.git/compare/49dbaae818cd...3a445ed

git log 49dbaae..3a445ed --no-merges --oneline
2019-10-08 30870216+gaaclarke@users.noreply.github.com Made _printDebug only happen on debug builds of the engine for now. (flutter/engine#12980)
2019-10-08 devoncarew@google.com remove references to package:_chrome (flutter/engine#12931)
2019-10-08 ditman@gmail.com Open source canvas tests from flutter_web_ui (flutter/engine#12819)
2019-10-08 mouad.debbar@gmail.com Prevent default when Tab is clicked (flutter/engine#12986)


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 chinmaygarde@google.com on the revert to ensure that a human
is aware of the problem.

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/+/master/autoroll/README.md
@mdebbar mdebbar deleted the prevent_default branch April 15, 2021 17:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants