mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-02-24 17:23:07 +01:00
Prevent default browser scroll on content focus (#2526)
This commit is contained in:
parent
83e45ac054
commit
861ba522b8
@ -173,9 +173,10 @@ class Content extends React.Component {
|
||||
}
|
||||
|
||||
// If the Slate selection is focused, but the DOM's active element is not
|
||||
// the editor, we need to focus it.
|
||||
// the editor, we need to focus it. We prevent scrolling because we handle
|
||||
// scrolling to the correct selection.
|
||||
if (selection.isFocused && activeElement !== this.element) {
|
||||
this.element.focus()
|
||||
this.element.focus({ preventScroll: true })
|
||||
updated = true
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user