Skip to content

Commit 8d76ba2

Browse files
authored
fix(rich-text-input): fix onBlur and onFocus (#1093)
1 parent 922e0cf commit 8d76ba2

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/components/inputs/rich-text-input/rich-text-input.js

+14-2
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,26 @@ class RichTextInput extends React.PureComponent {
4040
next();
4141

4242
if (this.props.onBlur) {
43-
setTimeout(() => this.props.onBlur(event), 0);
43+
const fakeEvent = {
44+
target: {
45+
id: this.props.id,
46+
name: this.props.name,
47+
},
48+
};
49+
setTimeout(() => this.props.onBlur(fakeEvent), 0);
4450
}
4551
};
4652

4753
onFocus = (event, editor, next) => {
4854
next();
4955
if (this.props.onFocus) {
50-
setTimeout(() => this.props.onFocus(event), 0);
56+
const fakeEvent = {
57+
target: {
58+
id: this.props.id,
59+
name: this.props.name,
60+
},
61+
};
62+
setTimeout(() => this.props.onFocus(fakeEvent), 0);
5163
}
5264
};
5365

0 commit comments

Comments
 (0)