Skip to content

Commit

Permalink
fix: pass readonly to MultipleSystemsDropdown via props. Make it disa…
Browse files Browse the repository at this point in the history
…bled if readonly.
  • Loading branch information
Tethik committed Jun 4, 2024
1 parent 3372089 commit e58381c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/src/components/elements/MultipleSystemsDropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export function MultipleSystemsDropdown({
systems,
onChange,
multiple,
readOnly,
...props
}) {
const [options, setOptions] = useState([]);
Expand All @@ -18,7 +19,6 @@ export function MultipleSystemsDropdown({
useLazySearchQuery();

const systemList = result?.systems;
const readOnly = useReadOnly();

useEffect(() => {
const newOptions = [];
Expand Down Expand Up @@ -67,8 +67,9 @@ export function MultipleSystemsDropdown({
autoHighlight
fullWidth
freeSolo
readOnly={readOnly}
filterSelectedOptions
readOnly={readOnly}
disabled={readOnly}
value={systems.map((s) => options.find((o) => o.value === s))}
getOptionLabel={(option) => (option.label ? option.label : option.value)}
isOptionEqualToValue={(option, value) => option.value === value.value}
Expand Down
1 change: 1 addition & 0 deletions app/src/components/model/panels/left/ComponentTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ export function ComponentTab() {
console.log("new val", v);
updateFields({ systems: v });
}}
readOnly={readOnly}
/>

<TextField
Expand Down

0 comments on commit e58381c

Please sign in to comment.