mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-09-09 14:40:41 +02:00
Don't remove selection when hovering over a non-selectable DOM element (#4577)
* Don't remove selection when hovering over a non-selectable node Fixes https://github.com/ianstormtaylor/slate/issues/4545 To reproduce the buggy behavior: 1. Create a page that renders a Slate element with a `contentEditable: false` element in it. 2. Start selecting some text with the mouse. 3. During the drag, mouseover the `contentEditable: false` element. Expected behavior: After doing a drag-to-select with the mouse, from a valid anchor point on mousedown to a valid focus point on mouseup, the selection is set to those anchor and focus points. Actual behavior: your selection is removed as soon as your mouse hits the `contentEditable: false` element. This is because the current behavior clears the selection if it is momentarily not a valid Slate location. * Add changeset
This commit is contained in:
5
.changeset/curly-timers-watch.md
Normal file
5
.changeset/curly-timers-watch.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'slate-react': patch
|
||||
---
|
||||
|
||||
Fixed a bug that removed the selection when hovering over a non-selectable DOM element
|
Reference in New Issue
Block a user