[w3c/webcomponents] An API for determining if the focused element is a text editor (#483)

>From https://bugs.chromium.org/p/chromium/issues/detail?id=398078, from @sorvell

1. A custom element wants to handle key events to perform an action. For example, arrow keys should advance a carousel; the delete key should remove a list item.
2. Any custom keyboard handling should be aborted if the focus is in an element that is a text editor (input, textarea, contenteditable, etc.).
3. To do so, the developer must write code that inspects the entire activeElement tree, including document.activeElement and any shadowRoot.activeElement within it. Each of these activeElements must be interrogated to determine if they are text editors. The need for this code is common and it is cumbersome to construct and brittle in nature.

To address this need, the platform should expose a direct api for determining if the currently focused element  will handle input by editing text.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/483

Received on Tuesday, 12 April 2016 06:32:12 UTC