qorf / quorum-language

The primary repository for the Quorum Programming Language
BSD 3-Clause "New" or "Revised" License
15 stars 6 forks source link

Handle focus and programmatic clicks in shadow DOM #4

Closed mwcampbell closed 2 years ago

mwcampbell commented 2 years ago
  1. WebAccessibility now sets the actual DOM focus to shadow elements, rather than setting aria-activedescendant on the canvas.
  2. The tabindex attribute is now actually set on shadow elements, but only for focusable Quorum items.
  3. WebInput and InputMonitor now test whether the DOM focus is in the canvas or one of its descendants, rather than just the canvas.
  4. WebInput now captures events, rather than letting them bubble up, to make sure it handles them before the browser default behavior runs, even when the focus is in a descendant of the canvas.
  5. WebInput now suppresses propagation and default behavior for mouse events, only if the mouse is inside the canvas.
  6. WebAccessibility now adds a focus event listener to focusable items, so it can set the Quorum focus when an AT programmatically focuses an element.
  7. Likewise, WebAccessibility now adds a click event listener on control elements, so it can call Activate on the Quorum control when an AT programmatically "clicks" the element.
  8. keepTabFocus in WebConfiguration now defaults to true. It seems to me that this is the better default in most cases; in particular, for programs run in the online IDE (e.g. on the Kitchen Sink) page, it's cleaner to trap tabbing on the Quorum side than to try to do so on the embedding side. Also, the behavior of relinquishing focus when the user presses Escape is now implemented in WebInput rather than in the JavaScript on the Quorum website; it's no longer possible for the latter to implement it, now that we're capturing key events.