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

fix: input mode for number type #3867

Closed
wants to merge 1 commit into from
Closed

fix: input mode for number type #3867

wants to merge 1 commit into from

Conversation

raulfdm
Copy link
Contributor

@raulfdm raulfdm commented Nov 14, 2022

Description

Closes #3866

This PR changes the inputMode property to be decimal instead number. See the implantation in the open Issue.

What to review

Check the number input.

Obs.: I tried to add an unit test to ensure this is not broken but I couldn't get the minRule condition working. I don't have much context for solving this kind of problem.

Notes for release

When type is number, uses HTML inputmode equals decimal instead number. This will show up on mobile the decimal keyboard.

@vercel
Copy link

vercel bot commented Nov 14, 2022

@raulfdm is attempting to deploy a commit to the Sanity Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Nov 14, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
studio-workshop ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Nov 14, 2022 at 6:34PM (UTC)

Copy link
Member

@bjoerge bjoerge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot! I've fixed the tests and changed the logic a bit so it still uses inputMode=numeric for fields that have .integer() or .precision(0) validation rules

Merged to both v2 (13e14ab) and v3 (38df0fb) and will be included in upcoming releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[V3] Field Type Number does not render the correct inputmode
2 participants