refactoring
This commit is contained in:
@@ -13,7 +13,7 @@ export class MentionList extends React.Component {
|
||||
componentDidUpdate(oldProps) {
|
||||
if (this.props.items !== oldProps.items) {
|
||||
this.setState({
|
||||
selectedIndex: 0
|
||||
selectedIndex: 0,
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -39,13 +39,13 @@ export class MentionList extends React.Component {
|
||||
|
||||
upHandler() {
|
||||
this.setState({
|
||||
selectedIndex: ((this.state.selectedIndex + this.props.items.length) - 1) % this.props.items.length
|
||||
selectedIndex: ((this.state.selectedIndex + this.props.items.length) - 1) % this.props.items.length,
|
||||
})
|
||||
}
|
||||
|
||||
downHandler() {
|
||||
this.setState({
|
||||
selectedIndex: (this.state.selectedIndex + 1) % this.props.items.length
|
||||
selectedIndex: (this.state.selectedIndex + 1) % this.props.items.length,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -66,9 +66,9 @@ export default () => {
|
||||
reactRenderer.destroy()
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
})
|
||||
}),
|
||||
],
|
||||
content: `
|
||||
<p>
|
||||
@@ -84,8 +84,8 @@ export default () => {
|
||||
return (
|
||||
<div>
|
||||
<EditorContent editor={editor} />
|
||||
{editor &&
|
||||
<div className={`character-count ${editor.getCharacterCount() === limit ? 'character-count--warning' : ''}`}>
|
||||
{editor
|
||||
&& <div className={`character-count ${editor.getCharacterCount() === limit ? 'character-count--warning' : ''}`}>
|
||||
<svg
|
||||
height="20"
|
||||
width="20"
|
||||
|
||||
Reference in New Issue
Block a user