Skip to content

Commit 63e20cc

Browse files
committed
Get document via editor session.
1 parent 2f47f2e commit 63e20cc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/article/shared/KeywordInput.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,16 @@ export default class KeywordInput extends CustomSurface {
3636
}
3737

3838
render ($$) {
39-
const doc = this.context.doc
39+
const editorSession = this.context.editorSession
40+
const doc = editorSession.getDocument()
4041
const model = this.props.model
4142
const values = model.getValue()
4243
const isEmpty = values.length === 0
4344
const isSelected = this.state.isSelected
4445
const isExpanded = this.state.isExpanded
45-
const label = isEmpty ? this.props.placeholder : values.map(v => doc.get([v, 'content'])).join(', ')
46+
const label = isEmpty ? this.props.placeholder : values.map(v => {
47+
return doc.get([v, 'content'])
48+
}).join(', ')
4649

4750
const el = $$('div').addClass('sc-keyword-input')
4851
if (isEmpty) el.addClass('sm-empty')

0 commit comments

Comments
 (0)