Created
February 1, 2022 17:52
-
-
Save unrealapex/defe8becc7e1450e30eb5df90d21937e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // taken from here: https://developer.mozilla.org/en-US/docs/Web/API/Document/activeElement | |
| function onMouseUp(e) { | |
| const activeTextarea = document.activeElement; | |
| const selection = activeTextarea.value.substring( | |
| activeTextarea.selectionStart, activeTextarea.selectionEnd | |
| ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment