primitives icon indicating copy to clipboard operation
primitives copied to clipboard

Fix Text Selection of HoverCard

Open akevinge opened this issue 2 years ago • 0 comments

Addresses: #1470

Implemented:

  • When selecting text in the Hover Card, don't allow the selection to spill out of the Hover Card bounds.
  • Don't close Hover Card on mouse out if there's an active text selection; require an additional pointer down instead.

I implemented a selection lock on outside text when the card is open by settings the user-select on document.body to 'none' and on the interior content to 'text'. This method is pretty hacky and doesn't work on force mounts. I'm also not sure if this has some unknown side effects. As such, I made the selection lock an opt-in prop.

Honestly, the first feature could just be implemented by the developer, but the second one seems like it needs to be implemented internally.

akevinge avatar Jun 19 '22 03:06 akevinge