зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1587557: When activating an HTML text field via a11y APIs, if it already has focus, simulate a click. r=MarcoZ
Previously, HTMLTextFieldAccessible::DoAction just called TakeFocus(). When the field already has focus, TakeFocus() will do nothing. However, the user might be activating this element because they dismissed a touch keyboard and want to bring it back. Therefore, we must simulate a click so Gecko will bring up the keyboard. Differential Revision: https://phabricator.services.mozilla.com/D54106 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
aabcbaf2bd
Коммит
a984f604fe
|
@ -373,7 +373,14 @@ void HTMLTextFieldAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName) {
|
|||
bool HTMLTextFieldAccessible::DoAction(uint8_t aIndex) const {
|
||||
if (aIndex != 0) return false;
|
||||
|
||||
TakeFocus();
|
||||
if (FocusMgr()->IsFocused(this)) {
|
||||
// This already has focus, so TakeFocus()will do nothing. However, the user
|
||||
// might be activating this element because they dismissed a touch keyboard
|
||||
// and want to bring it back.
|
||||
DoCommand();
|
||||
} else {
|
||||
TakeFocus();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче