ibm-js / delite

HTML Custom Element / Widget infrastructure
http://ibm-js.github.io/delite/
Other
68 stars 28 forks source link

[regression] KeyNav problem with removing tabindex from child #473

Closed wkeese closed 7 years ago

wkeese commented 7 years ago
  1. Open deliteful/tests/functional/list/list-mark-1.html.
  2. Click on "list item 0".
  3. Click on "list item 1"
  4. Hit space bar.
  5. Expected: "list item 1" deselected. Actual: "list scrolls"

(report from @brunano21)

For a more isolated test case, just click the elements in the grid in KeyNavTests.html and see how half turn yellow and half turn blue.

wkeese commented 7 years ago

The problem his that the second click (step 3) removes the tabindex from the <div class="d-list-cell"> so focus moves to <body>. That happens in KeyNav#focusoutHandler(), on this line:

this.navigatedDescendant.removeAttribute("tabindex");

I guess the root issue is that this.navigatedDescendant has already been updated to point to the new descendant whereas focusoutHandler() assumes it still points to the old descendant. this.navigatedDescendant was set in _descendantNavigateHandler() which was called from pointerdownHandler().

Note that when navigating by keyboard, focusoutHandler() is called before _descendantNavigateHandler(), because _descendantNavigateHandler() is called by focusinHandler() rather than pointerdownHandler().

Regression from #462.