From d5915c7598ca7f7ae1bdc091ad9d730d413d8681 Mon Sep 17 00:00:00 2001 From: Sam Zhou Date: Sun, 26 Apr 2020 13:25:06 -0400 Subject: [PATCH] Fix #350 (#351) ### Summary Use currentTarget since it's more reliable, and it solves the problem. ### Test Plan Type a letter. It no longer crashes. ### Notes https://github.com/facebook/react/issues/5733 --- src/components/includes/ProfessorTagInfo.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/includes/ProfessorTagInfo.tsx b/src/components/includes/ProfessorTagInfo.tsx index e78ff05bd..8e9e19095 100644 --- a/src/components/includes/ProfessorTagInfo.tsx +++ b/src/components/includes/ProfessorTagInfo.tsx @@ -43,7 +43,8 @@ class ProfessorTagInfo extends React.Component { } handleNameChange = (event: React.ChangeEvent): void => { - this.setState((state) => ({ tag: { ...state.tag, name: event.target.value } })); + const name = event.currentTarget.value; + this.setState((state) => ({ tag: { ...state.tag, name } })); }; handleNewTagTextChange = (event: React.ChangeEvent): void => {