Skip to content

Commit

Permalink
feat(frontend): select whole input when updating progress
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnisDa committed Nov 23, 2024
1 parent beeb292 commit 35712d8
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions apps/frontend/app/routes/_dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -995,17 +995,18 @@ const MetadataInProgressUpdateForm = ({
style={{ flexGrow: 1 }}
/>
<NumberInput
w="20%"
min={0}
step={1}
max={100}
hideControls
value={value}
onFocus={(e) => e.target.select()}
rightSection={<IconPercentage size={16} />}
onChange={(v) => {
if (v) setValue(Number(v));
else setValue(undefined);
}}
max={100}
min={0}
step={1}
w="20%"
hideControls
rightSection={<IconPercentage size={16} />}
/>
</Group>
{total ? (
Expand All @@ -1019,8 +1020,9 @@ const MetadataInProgressUpdateForm = ({
step={1}
flex={1}
hideControls
max={Number(total)}
leftSection={updateIcon}
max={Number(total)}
onFocus={(e) => e.target.select()}
defaultValue={((Number(total) || 1) * (value || 1)) / 100}
onChange={(v) => {
const value = (Number(v) / (Number(total) || 1)) * 100;
Expand Down

0 comments on commit 35712d8

Please sign in to comment.