mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-17 20:51:20 +02:00
Fix selection being reset incorrectly after combination of events (#2686)
* Fix selection being reset incorrectly after combination of events If mouseDown happens inside editor container and mouseUp outside it, then programmatically calling editor.focus() after that will mess up the selection * Update after.js
This commit is contained in:
committed by
Ian Storm Taylor
parent
7855783b2d
commit
feaad7e7cd
@@ -634,6 +634,11 @@ function AfterPlugin(options = {}) {
|
||||
const window = getWindow(event.target)
|
||||
const selection = window.getSelection()
|
||||
setSelectionFromDom(window, editor, selection)
|
||||
|
||||
// COMPAT: reset the `isMouseDown` state here in case a `mouseup` event
|
||||
// happens outside the editor. This is needed for `onFocus` handling.
|
||||
isMouseDown = false
|
||||
|
||||
next()
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user