Skip to content

Commit f643695

Browse files
authored
Fix tag input (#3832)
1 parent 5da8e8f commit f643695

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/web/src/components/data-entry/TagInput.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,14 @@ class TagInput extends Component {
3434

3535
newTagInputRef = createRef()
3636

37-
componentDidUpdate = () => {
37+
componentDidUpdate = (prevProps, prevState) => {
3838
if (this.state.typingMode && this.newTagInputRef.current) {
3939
this.newTagInputRef.current.focus()
4040
}
41-
if (this.state.tags !== this.props.tags) {
41+
if (
42+
prevState.tags === this.state.tags &&
43+
prevProps.tags !== this.props.tags
44+
) {
4245
this.setState({ tags: this.props.tags })
4346
}
4447
}

0 commit comments

Comments
 (0)