aboutsummaryrefslogtreecommitdiff
path: root/modern/src/settings/components/BaseCommandView.jsx
diff options
context:
space:
mode:
authorMatjaž Črnko <m.crnko@txt.si>2024-01-19 19:21:02 +0100
committerMatjaž Črnko <m.crnko@txt.si>2024-01-19 19:21:02 +0100
commit783eccb019824946d758c31f2f945ce2fc80fc2a (patch)
tree4b5c34e4b15dac4d924d5be356cdf08c990b2cfc /modern/src/settings/components/BaseCommandView.jsx
parentbf2c17247e59a3ee4bdc88647b167918253d231c (diff)
downloadtrackermap-web-783eccb019824946d758c31f2f945ce2fc80fc2a.tar.gz
trackermap-web-783eccb019824946d758c31f2f945ce2fc80fc2a.tar.bz2
trackermap-web-783eccb019824946d758c31f2f945ce2fc80fc2a.zip
wip: Modify SelectField so that it uses Autocomplete component instead of Select with single select
Diffstat (limited to 'modern/src/settings/components/BaseCommandView.jsx')
-rw-r--r--modern/src/settings/components/BaseCommandView.jsx3
1 files changed, 2 insertions, 1 deletions
diff --git a/modern/src/settings/components/BaseCommandView.jsx b/modern/src/settings/components/BaseCommandView.jsx
index acf39090..070ecfed 100644
--- a/modern/src/settings/components/BaseCommandView.jsx
+++ b/modern/src/settings/components/BaseCommandView.jsx
@@ -28,9 +28,10 @@ const BaseCommandView = ({ deviceId, item, setItem }) => {
return (
<>
<SelectField
- value={item.type || ''}
+ value={item.type || null}
onChange={(e) => setItem({ ...item, type: e.target.value, attributes: {} })}
endpoint={deviceId ? `/api/commands/types?${new URLSearchParams({ deviceId }).toString()}` : '/api/commands/types'}
+ keyField='type'
keyGetter={(it) => it.type}
titleGetter={(it) => t(prefixString('command', it.type))}
label={t('sharedType')}