Text insertion?

Hey everyone. My extension adds a little icon at the bottom of inputs or contenteditable divs (like many extensions do). When clicking that icon, a popover with a textarea appears and you can write on it. After clicking a little button next to the textarea, a API call is made and I want to set the result of that API call to the input (a.k.a. the anchor) in the position the caret was before the user opened the popover. Has anyone accomplished that already? What's the best way? I've implemented a solution but it's not really reliable. I'm happy to share my code. Thanks!
1 Reply
lab
lab•2y ago
I would prob just use web API with the startSelection props of the cursor object
Want results from more Discord servers?
Add your server