content icon indicating copy to clipboard operation
content copied to clipboard

[WebAPI] Show focus indication on elements when focus set programmatically

Open hamishwillee opened this issue 3 years ago • 1 comments

Acceptance Criteria

  • [x] The listed features are documented sufficiently on MDN
  • [x] BCD is updated
  • [x] Interactive example and data repos are updated if appropriate
  • [x] The content has been reviewed as needed

For folks helping with Firefox related documentation

  • [x] Set bugs to dev-doc-complete
  • [x] Add entry to Firefox release notes if feature is enabled in release or
  • [ ] Add entry to Firefox experimental features page if feature is not yet enabled in release

Features to document

Now parameter to HTMLElement.focus() parameter - focusVisible

Probably worth doing an interactive example.

Actual results:

The element focused does not get a focus ring unless it is an INPUT element of type TEXT or a TEXTAREA.

Related Gecko bugs

https://bugzilla.mozilla.org/show_bug.cgi?id=1765083

Other

Previously it was entirely up to the UA to decide if it should visibly indicate an element as focused if focus was set by javascript. Generally this was done for text areas but not necessarily for other elements. The spec was updated around April to add an option to HTMLElement.focus() to allow the programmer to say whether they want this or not.

The update to spec was done here: https://github.com/whatwg/html/pull/8087

hamishwillee avatar Aug 09 '22 01:08 hamishwillee

Status

  • [x] BCD - https://github.com/mdn/browser-compat-data/pull/17278
  • [x] Docs - #19311
  • [x] Release note - #19311
  • [x] dev-docs-complete

I think this is pretty much done bar reviews

hamishwillee avatar Aug 09 '22 01:08 hamishwillee