diff --git a/components/mention/demo/basic.md b/components/mention/demo/basic.md index ae48cec6ea..b0dcfbb992 100644 --- a/components/mention/demo/basic.md +++ b/components/mention/demo/basic.md @@ -15,7 +15,7 @@ Basic usage. import { Mention } from 'antd'; -function onChange(value) { +function onChange(editorState, value) { console.log(value); } diff --git a/components/mention/demo/multilines.md b/components/mention/demo/multilines.md index 7d82a2262f..9148c408dc 100644 --- a/components/mention/demo/multilines.md +++ b/components/mention/demo/multilines.md @@ -15,7 +15,7 @@ Multi lines mode. import { Mention } from 'antd'; -function onChange(value) { +function onChange(editorState, value) { console.log(value); } diff --git a/components/mention/index.en-US.md b/components/mention/index.en-US.md index ddc397806f..2821aca970 100644 --- a/components/mention/index.en-US.md +++ b/components/mention/index.en-US.md @@ -28,11 +28,12 @@ When need to mention someone or something. | suggestions | suggestion content | Array or Array | [] | | suggestionStyle | style of suggestion container | Objet | {} | | onSearchChange | Callback function called when search content changes | function(value:String) | [] | -| onChange | Callback function called when content of input changes | function(value:String) | null | +| onChange | Callback function called when content of input changes | function(editorState: EditorState, value:String) | null | | notFoundContent| suggestion when suggestions empty | string | '无匹配结果,轻敲空格完成输入' | | loading | loading mode | boolean | false | | multiLines | multilines mode | boolean | false | | defaultValue | default value | string | null | +| value | core state of mention | EditorState | null | ### Nav props diff --git a/components/mention/index.tsx b/components/mention/index.tsx index 2c769b4663..85253e26b3 100644 --- a/components/mention/index.tsx +++ b/components/mention/index.tsx @@ -54,7 +54,7 @@ export default class Mention extends React.Component onChange(editorState, textValue) { if (this.props.onChange) { - this.props.onChange(textValue); + this.props.onChange(editorState, textValue); } } diff --git a/components/mention/index.zh-CN.md b/components/mention/index.zh-CN.md index b42d6ac860..22f2652290 100644 --- a/components/mention/index.zh-CN.md +++ b/components/mention/index.zh-CN.md @@ -28,11 +28,12 @@ english: Mention | suggestions | 建议内容 | Array or Array | [] | | suggestionStyle | 弹出下拉框样式 | Objet | {} | | onSearchChange | 输入框中 @ 变化时回调 | function(value:String) | [] | -| onChange | 输入框内容变化时回调 | function(value:String) | null | +| onChange | 输入框内容变化时回调 | function(editorState: EditorState, value:String) | null | | notFoundContent| 未找到时的内容 | string | '无匹配结果,轻敲空格完成输入' | | loading | 加载中 | boolean | false | | multiLines | 多行模式 | boolean | false | | defaultValue | 默认值 | string | null | +| value | 值 | EditorState | null | ### Nav props diff --git a/package.json b/package.json index 5301e69dc5..48eb12cd60 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "rc-collapse": "~1.6.3", "rc-dialog": "~6.1.1", "rc-dropdown": "~1.4.8", - "rc-editor-mention": "~0.0.27", + "rc-editor-mention": "0.0.29", "rc-form": "~0.17.1", "rc-input-number": "~2.5.12", "rc-menu": "~4.12.4",