Skip to content

Commit

Permalink
Fix warning resulting from controlling select with boolean 'selected'
Browse files Browse the repository at this point in the history
  • Loading branch information
CannonLock committed Jan 19, 2024
1 parent a5a7a37 commit 59ea06a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/pages/maps/@id/edit/table-menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ const TableMenu = ({columnName, onFilterChange, filter, onGroupChange, group} :
borderBottom: "none",
borderRadius: "2px 2px 0 0",
},
value: filter.operator,
onChange: (e) => {
if (e.target.value === "na") {
onFilterChange({operator: undefined, value: filter.value})
Expand All @@ -76,7 +77,9 @@ const TableMenu = ({columnName, onFilterChange, filter, onGroupChange, group} :
}
}, [
...validExpressions.map((expression) => {
return h("option", {value: expression.key, selected: expression.key === filter.operator}, [expression.verbose])
return h("option", {
value: expression.key,
}, [expression.verbose])
})
]),
h("div.filter-input", {}, [
Expand All @@ -87,6 +90,10 @@ const TableMenu = ({columnName, onFilterChange, filter, onGroupChange, group} :
onChange: (e: React.ChangeEvent<HTMLInputElement>) => {
setInputValue(e.target.value);
debouncedInputChange(e)
},
onBlur: (e: React.FocusEvent<HTMLInputElement>) => {
// Make sure this value gets published if the menu is hidden be debounce
onInputChange(e)
}
}, [])
])
Expand Down

0 comments on commit 59ea06a

Please sign in to comment.