Bug 1788698 Comment 1 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

While working on [1767250](https://bugzilla.mozilla.org/show_bug.cgi?id=1767250), we discovered that when the `type` attribute is mutated onclick from button to text we end up in an undefined focus state, where the `:focus-visible` class is not shown but the element is focused. 
For context, here is a [codesandbox](https://codesandbox.io/s/young-flower-b73yuo?file=/index.html) with a minimal reproduction of the issue. When clicking the button, the resulting text input should have the outer focus ring.
While working on [1767250](https://bugzilla.mozilla.org/show_bug.cgi?id=1767250), we discovered that when the `type` attribute is mutated onclick from button to text we end up in an undefined focus state, where  `:focus-visible`  is not applied but the element is focused. 
For context, here is a [codesandbox](https://codesandbox.io/s/young-flower-b73yuo?file=/index.html) with a minimal reproduction of the issue. When clicking the button, the resulting text input should have the outer focus ring.

Back to Bug 1788698 Comment 1