Last active
June 22, 2023 09:33
-
-
Save Fanoflix/c7145e205b89e165477e334c3d6f4553 to your computer and use it in GitHub Desktop.
Method to get highlighted/selection text
This file contains 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
const getSelectionText = () => { | |
const selectionText = window.getSelection()?.toString() | |
if (selectionText?.length) return selectionText | |
} |
Author
Fanoflix
commented
Jun 22, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment