react-client icon indicating copy to clipboard operation
react-client copied to clipboard

Remove Focus from button when they open a modal

Open DerMolly opened this issue 3 years ago • 3 comments

Description A button that opens a modal still has focus, when the modal is closed.

This can be observed with the 'Editor settings' button.

Expected behavior If a button opens a modal, it should lose focus, when the modal is closed.

Screenshots be2fa9ef-4312-4918-af98-d4e13c5d267a

DerMolly avatar Jan 11 '22 12:01 DerMolly

Probably releveant https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/blur

DerMolly avatar Feb 08 '22 06:02 DerMolly

Instead of just blurring, the focus should be set back to the element before the button action. For example when clicking a toolbar button while having text selected, the focus should return to the selected text after the button click.

ErikMichelson avatar Feb 08 '22 21:02 ErikMichelson

This should already be the behaviour in the codemirro 6 branch.

mrdrogdrog avatar Feb 08 '22 22:02 mrdrogdrog