[CrOS Network] Fix InternetDetailPage keyboard navigation issue.
Before this CL, tabbing to the subpage arrow of a network list item and pressing Enter would cause two "show-detail" events to be fired instead of one. In the settings page, the outcome of this error was that users would be navigated to the details page but would have to click the back arrow twice to go to the previous page. This issue was caused by the use of <iron-a11y-keys>; this element handled the "keydown" event by dispatching its own "keys-pressed" event, which was handled by <cr-network-list-item> to navigate to the next page. <cr-network-list-item> stopped propagation of the event, but this was not good enough, since the event it was stopping was the "keys-pressed" event, not the "keydown" event. Since the default action of pressing Enter when a button is focused is to simulate a click, this still occurred and caused the subpage arrow's click handler to be called. Additionally, a second issue was caused by the interaction of <iron-a11y-keys> and <iron-list>. Since both of these handle the "keydown" event and <cr-network-list-item> only handles the "keys-pressed" event, the <cr-network-list-item> could not stop propagation onf the original "keydown" event, resulting in the <iron-list>'s handler also being invoked. This CL fixes these issues by: (1) Removing use of the <iron-a11y-keys> element and replacing it with explicit "keydown" listeners via this.listen(). (2) Stopping the propagation of the "keydown" event instead of of the "keys-pressed" event. (3) Preventing the default action of the "keydown" event. Bug: 736963 Change-Id: Ibb1c8c0484a1bc243586ebdee95fe1e3e357b94a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1540676Reviewed-by:Steven Bennetts <stevenjb@chromium.org> Commit-Queue: Kyle Horimoto <khorimoto@chromium.org> Cr-Commit-Position: refs/heads/master@{#644880}
Showing
Please register or sign in to comment