From 3dba017e973f8478fa91dec077e06de697f5d010 Mon Sep 17 00:00:00 2001 From: Trip Tate Date: Wed, 13 May 2020 22:12:12 -0400 Subject: [PATCH] make sure there is an event to persist --- src/Mentions.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Mentions.tsx b/src/Mentions.tsx index 9376063..9bfb925 100644 --- a/src/Mentions.tsx +++ b/src/Mentions.tsx @@ -245,7 +245,7 @@ class Mentions extends React.Component { public onBlur = (event?: React.FocusEvent) => { // 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) { + if (event && event.persist) { event.persist(); } this.focusId = window.setTimeout(() => {