react-query-assist
react-query-assist copied to clipboard
Highlighting token pairs does not work
Quick gif demonstrating the issue https://cl.ly/0H1r123U350r.
Good catch.
Thought it would be a simple fix, but this uncovered another issue: https://cl.ly/2D4404372y1O
The input overlay currently has pointer-events: none
to allow select/click events to pass through to the input itself. But I had to counteract that with pointer-events: auto
on the highlighted tokens, to allow for the click and hover events. So the problem is when you start a selection inside the token and try to drag to non-token text, it breaks since you're selecting text in the overlay span rather than the input itself.
Not really sure how to get around this other than disabling the hover effect and click event on the highlighted token. Any ideas?
Why not store the up/down click state of the cursor? When the mouse state is down you know can allow selecting of the textarea, when it's up you can display the overlay.