Re: [w3c/webcomponents] Add custom element default focusability proposal (#834)

rakina commented on this pull request.



> +<input type="button" value="Click me">
+<my-button>Click me</my-button>
+```
+
+## Proposal
+
+Add a new property `matchFocusBehaviorOf` to `ElementInternals`, which accepts a string containing a tagname and optionally an attribute with a value (so it will accept values like `div`, `a[href]`, `input[type='checkbox']` , but not `.class`, `*`, etc.). The custom element will then be treated as if it has that tagname and attribute in terms of focus.
+
+## Alternatives considered
+
+### Using other ways to represent the built-in elements
+
+The proposed API above uses a CSS selectors to represent the built-in elements, but we’ve also considered some variants:
+
+ - Using “tagname + one attribute name + attribute’s value” combination,
+   e.g. `elementInternals.matchFocusBehaviorOf = {"input", "type," "button"}`

Oops, changed. Thanks!

-- 
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/pull/834#discussion_r320890934

Received on Wednesday, 4 September 2019 17:48:44 UTC