1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-24 16:02:55 +02:00

swap to isFocused for consistency

This commit is contained in:
Ian Storm Taylor
2016-06-15 20:13:02 -07:00
parent 56727704ee
commit 769f59798f
4 changed files with 13 additions and 13 deletions

File diff suppressed because one or more lines are too long

View File

@@ -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

View File

@@ -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

View File

@@ -11,7 +11,7 @@ const SelectionRecord = new Record({
focusKey: null,
focusOffset: 0,
isBackward: false,
hasFocus: false
isFocused: false
})
/**