mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-11-02 19:29:10 +08:00
The accessibility bug below is about lost keyboard focus after using keyboard to edit style rules. It reveals a flaw in the style editing code: it is justifiable to call "toggle property and continue editing" when the property is being typed. But when the command handler realizes that we need to cancel this editing, the following problems occured. 1) The cancel editing code is called before the necessary information for continuing editing is gathered. An exception can be thrown. The fix orders them correctly. 2) The continue editing code does not set the focuses correctly. There are three situations: 2.a) the canceled editing is in the middle of a list of properties; focus/editing-starting position should be at the next property. 2.b) the canceled editing is at the end of a list of properties; it should be reasonable to set focus/editing-starting position at the last property. 2.c) the section has no css rules; it is reasonable to set focus on the section itself. Screen recording for 2.a and 2.c: continue editing the next property: https://imgur.com/VFJjhE2 no property in section, focus on section: https://imgur.com/mlhgo5t Change-Id: Ic8c41ef3acc4f55331356b651aabcf7dc90ca43e Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1081766 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2196823 Reviewed-by: Vidal Diazleal <vidorteg@microsoft.com> Reviewed-by: Brian Cui <brcui@microsoft.com> Commit-Queue: Songtao Xia <soxia@microsoft.com>