Skip to content

Commit

Permalink
Fix #350
Browse files Browse the repository at this point in the history
### Summary

Use currentTarget since it's more reliable, and it solves the problem.

### Test Plan

Type a letter. It no longer crashes.

### Notes

facebook/react#5733
  • Loading branch information
SamChou19815 committed Apr 26, 2020
1 parent 4ced42e commit c4e8b40
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/includes/ProfessorTagInfo.tsx
Expand Up @@ -43,7 +43,8 @@ class ProfessorTagInfo extends React.Component<PropTypes, State> {
}

handleNameChange = (event: React.ChangeEvent<HTMLInputElement>): 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<HTMLInputElement>): void => {
Expand Down

0 comments on commit c4e8b40

Please sign in to comment.