Skip to content

Commit

Permalink
persist the blur event so clients can use it
Browse files Browse the repository at this point in the history
  • Loading branch information
triptate committed Apr 22, 2020
1 parent 83ea08a commit dea5aaa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Mentions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,11 @@ class Mentions extends React.Component<MentionsProps, MentionsState> {
};

public onBlur = (event?: React.FocusEvent<HTMLTextAreaElement>) => {
// the timeout causes onBlur to be called async, which causes the react synthetic
// event to be nullified. persist it if possible so clients can use it.
if (event.persist) {
event.persist();
}
this.focusId = window.setTimeout(() => {
const { onBlur } = this.props;
this.setState({ isFocus: false });
Expand Down

0 comments on commit dea5aaa

Please sign in to comment.