Skip to content

Commit

Permalink
2314: callback to add regions to formstateobject
Browse files Browse the repository at this point in the history
  • Loading branch information
sinejespersen committed Oct 7, 2024
1 parent f5ee277 commit d0f9f54
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/screen/screen-form.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ function ScreenForm({
);
if (localSelectedLayout) {
setSelectedLayout(localSelectedLayout);
handleInput({
target: { id: "regions", value: localSelectedLayout.regions },
});
}
}
}, [screen.layout, layoutOptions]);
Expand All @@ -84,6 +87,7 @@ function ScreenForm({
*/
const handleAdd = ({ target }) => {
const { value, id } = target;

setSelectedLayout(value);
handleInput({
target: { id, value: value.map((item) => item["@id"]).shift() },
Expand Down Expand Up @@ -250,7 +254,7 @@ function ScreenForm({
noSelectedString={t("nothing-selected-resolution")}
handleSelection={handleInput}
options={resolutionOptions}
selected={screen.resolution || ""}
selected={screen.resolution || []}
name="resolution"
singleSelect
/>
Expand All @@ -259,7 +263,7 @@ function ScreenForm({
noSelectedString={t("nothing-selected-orientation")}
handleSelection={handleInput}
options={orientationOptions}
selected={screen.orientation || ""}
selected={screen.orientation || []}
name="orientation"
singleSelect
/>
Expand Down

0 comments on commit d0f9f54

Please sign in to comment.