mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-08-06 04:55:15 -05:00
Tournaments points input make zero go away when focusing
This commit is contained in:
parent
2a23a26eed
commit
35d5055ac0
|
|
@ -203,6 +203,7 @@ function PointInput({
|
|||
presentational: boolean;
|
||||
testId?: string;
|
||||
}) {
|
||||
const [focused, setFocused] = React.useState(false);
|
||||
const id = React.useId();
|
||||
|
||||
if (presentational) {
|
||||
|
|
@ -221,10 +222,14 @@ function PointInput({
|
|||
type="number"
|
||||
min={0}
|
||||
max={100}
|
||||
value={value}
|
||||
value={focused && !value ? "" : String(value)}
|
||||
required
|
||||
id={id}
|
||||
data-testid={testId}
|
||||
pattern="[0-9]*"
|
||||
inputMode="numeric"
|
||||
onFocus={() => setFocused(true)}
|
||||
onBlur={() => setFocused(false)}
|
||||
/>
|
||||
<Label htmlFor={id} spaced={false}>
|
||||
Score
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user