From d25450f7bd75d1aff1bd6da8c99db4d800098976 Mon Sep 17 00:00:00 2001 From: hensm Date: Wed, 19 Aug 2020 22:52:13 +0100 Subject: [PATCH] Fix issue with double-clicking whitelist field whilst editing --- ext/src/ui/options/EditableList.tsx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/ext/src/ui/options/EditableList.tsx b/ext/src/ui/options/EditableList.tsx index fc2755e..f5c3b17 100644 --- a/ext/src/ui/options/EditableList.tsx +++ b/ext/src/ui/options/EditableList.tsx @@ -282,13 +282,15 @@ class EditableListItem extends Component< } private handleEditBegin () { - this.setState({ - editing: true - , editValue: this.props.text - }, () => { - this.input?.focus(); - this.input?.select(); - }); + if (!this.state.editing) { + this.setState({ + editing: true + , editValue: this.props.text + }, () => { + this.input?.focus(); + this.input?.select(); + }); + } } private handleEditEnd (ev: React.FocusEvent) {