copy-lite icon indicating copy to clipboard operation
copy-lite copied to clipboard

Minor accessibility improvement for focus state

Open AustinGil opened this issue 6 years ago • 0 comments

This code depends on creating a textarea, focusing on it, copying, then removing the textarea from the DOM. In doing so, the focus state will be passed to the textarea, and then lost. By tracking the document's active element and then focusing back to it after the copy, we can maintain a predictable focus state for users that rely on keyboard navigation. SWEET!

AustinGil avatar Oct 31 '19 21:10 AustinGil