code-input icon indicating copy to clipboard operation
code-input copied to clipboard

TODO Add unit tests: `focus` and `blur` functions should be passed from code-input to textarea for consistency

Open WebCoder49 opened this issue 5 months ago • 2 comments

Currently they are not passed and do nothing since code-input elements aren't focusable and making them focusable would be illogical. The consistency is with the focus event, selectionStart, selectionEnd, etc.

WebCoder49 avatar Jul 27 '25 15:07 WebCoder49

~~This isn't backwards compatible.~~ It is because anyone who focuses the code-input element will have expected the textarea to focus. There is no difference to screenreaders between the code-input and textarea being focused, and no other reason to focus the code-input. tabindex should be similarly synced.

WebCoder49 avatar Jul 27 '25 16:07 WebCoder49

TODO tests

WebCoder49 avatar Aug 10 '25 15:08 WebCoder49

Tests have been added to tests/hljs.html and tests/prism.html.

WebCoder49 avatar Dec 10 '25 22:12 WebCoder49