mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-23 23:42:56 +02:00
swap to isFocused for consistency
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -83,9 +83,9 @@ class Content extends React.Component {
|
||||
let { selection } = state
|
||||
const native = window.getSelection()
|
||||
|
||||
// No selection is active, so unset `hasFocus`.
|
||||
if (!native.rangeCount && selection.hasFocus) {
|
||||
selection = selection.set('hasFocus', false)
|
||||
// No selection is active, so unset `isFocused`.
|
||||
if (!native.rangeCount && selection.isFocused) {
|
||||
selection = selection.set('isFocused', false)
|
||||
state = state.set('selection', selection)
|
||||
this.onChange(state)
|
||||
return
|
||||
@@ -116,7 +116,7 @@ class Content extends React.Component {
|
||||
selection = selection.set('focusKey', focus.key)
|
||||
selection = selection.set('focusOffset', focus.offset)
|
||||
selection = selection.set('isBackward', isBackward)
|
||||
selection = selection.set('hasFocus', true)
|
||||
selection = selection.set('isFocused', true)
|
||||
state = state.set('selection', selection)
|
||||
this.onChange(state)
|
||||
return
|
||||
|
@@ -29,7 +29,7 @@ class LeafNode extends React.Component {
|
||||
const { selection } = state
|
||||
|
||||
// If the selection is not focused we have nothing to do.
|
||||
if (!selection.hasFocus) return
|
||||
if (!selection.isFocused) return
|
||||
|
||||
const { anchorKey, anchorOffset, focusKey, focusOffset } = selection
|
||||
const { node, range } = this.props
|
||||
|
@@ -11,7 +11,7 @@ const SelectionRecord = new Record({
|
||||
focusKey: null,
|
||||
focusOffset: 0,
|
||||
isBackward: false,
|
||||
hasFocus: false
|
||||
isFocused: false
|
||||
})
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user