aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ks129 <[email protected]>2021-02-18 10:40:45 +0200
committerGravatar GitHub <[email protected]>2021-02-18 10:40:45 +0200
commit6ae1bb7a5de86dca3a8452eb93f00bd5bd6f8e1b (patch)
tree842c311850552e05689c6a48a18088ff3d6e1914
parentAdd focus handler for select (thanks Scaleios) (diff)
Don't overwrite user selection
-rw-r--r--src/components/InputTypes/Select.tsx8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/components/InputTypes/Select.tsx b/src/components/InputTypes/Select.tsx
index e01b2e9..2d0187a 100644
--- a/src/components/InputTypes/Select.tsx
+++ b/src/components/InputTypes/Select.tsx
@@ -178,9 +178,11 @@ class Select extends React.Component<SelectProps> {
}
focusOption(): void {
- this.props.state_dict.set("value", "temporary");
- this.props.onBlurHandler();
- this.props.state_dict.set("value", null);
+ if (!this.props.state_dict.get("value")) {
+ this.props.state_dict.set("value", "temporary");
+ this.props.onBlurHandler();
+ this.props.state_dict.set("value", null);
+ }
}
render(): JSX.Element {