Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use inputmode="numeric" for results entry #2080

Merged
merged 1 commit into from
Jul 26, 2023

Conversation

symroe
Copy link
Member

@symroe symroe commented May 12, 2023

As per a request in Slack, the type=number input isn't useful for various reasons.

GDS moved to inputmode="numeric" for number inputs, so that's what we'll do too.

This could be moved to DC utils at some point, however as the project doesn't currently use the design system I didn't think it was worth adding there in order to make this change.

Test by going to enter results and seeing that the input type has changed.

image

Tasks

@Bekabyx
Copy link
Contributor

Bekabyx commented May 15, 2023

I think this is a good change, but it might be worth setting the oninvalid property because the default invalid message references a requested format that we haven't actually requested

Screenshot 2023-05-15 at 17 28 58

Also, the turnout % field doesn't seem to accept a number containing a decimal point, which isn't a problem if it's inferred from the turnout + electorate but is a problem if we need to go back in and edit that form at a later date because it then won't save.

In testing this I accidentally triggered the animated coin toss thing that I didn't know existed and I think I'd like to talk about that when you're back 😂

@symroe symroe force-pushed the feature/better-number-inputs branch from 45470db to c338f82 Compare July 17, 2023 11:55
@symroe
Copy link
Member Author

symroe commented Jul 17, 2023

@Bekabyx thanks for this review. I've pushed a fixup that I think deals with all your comments (apart form the coin!)

@symroe symroe force-pushed the feature/better-number-inputs branch from 5e41620 to a52432e Compare July 26, 2023 20:28
@symroe symroe merged commit a00105b into master Jul 26, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants