Skip to content

Commit

Permalink
fix: set proper value while for combobox
Browse files Browse the repository at this point in the history
  • Loading branch information
peckz committed Sep 24, 2024
1 parent 05ef190 commit b3039be
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pages/utilities/css-units-converter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export default function CSSUnitsConverter() {
<Combobox
data={unitOptions}
value={unit.from}
onSelect={(value) => setUnit({from: value , to: unit.to})}
onSelect={(value) => setUnit({ from: value, to: unit.to })}
/>
</div>
<div className="flex flex-col justify-end">
Expand All @@ -162,7 +162,7 @@ export default function CSSUnitsConverter() {
<Combobox
data={unitOptions}
value={unit.to}
onSelect={(value) => setUnit({from: unit.from , to: value})}
onSelect={(value) => setUnit({ from: unit.from, to: value })}
/>
</div>
</div>
Expand Down
11 changes: 9 additions & 2 deletions pages/utilities/number-base-changer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,12 @@ export default function NumberBaseChanger() {
<Combobox
data={data}
value={base.from.toString()}
onSelect={(value) => switchValues}
onSelect={(value) => {
setBase((prev) => ({
...prev,
from: parseInt(value),
}));
}}
/>
</div>
<div className="flex flex-col justify-end">
Expand All @@ -84,7 +89,9 @@ export default function NumberBaseChanger() {
<Combobox
data={data}
value={base.to.toString()}
onSelect={(value) => switchValues}
onSelect={(value) => {
setBase((prev) => ({ ...prev, to: parseInt(value) }));
}}
/>
</div>
</div>
Expand Down

0 comments on commit b3039be

Please sign in to comment.