Skip to content

Commit 9797fae

Browse files
committed
persist the blur event so clients can use it
1 parent e613351 commit 9797fae

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Mentions.tsx

+5
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,11 @@ class Mentions extends React.Component<MentionsProps, MentionsState> {
247247
};
248248

249249
public onBlur = (event?: React.FocusEvent<HTMLTextAreaElement>) => {
250+
// the timeout causes onBlur to be called async, which causes the react synthetic
251+
// event to be nullified. persist it if possible so clients can use it.
252+
if (event.persist) {
253+
event.persist();
254+
}
250255
this.focusId = window.setTimeout(() => {
251256
const { onBlur } = this.props;
252257
this.setState({ isFocus: false });

0 commit comments

Comments
 (0)