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

[V3] Field Type Number does not render the correct inputmode #3866

Closed
raulfdm opened this issue Nov 14, 2022 · 2 comments
Closed

[V3] Field Type Number does not render the correct inputmode #3866

raulfdm opened this issue Nov 14, 2022 · 2 comments

Comments

@raulfdm
Copy link
Contributor

raulfdm commented Nov 14, 2022

Describe the bug

Before I start, I want to point out that those changes impact me while using my CMS on mobile (iOS 16). On web it wouldn't matter due to the keyboard usage.

I have a bunch of schemas containing number fields.

In v2, a number field renders an input type text (which, let's be honest, isn't the best option semantic for an input):

Latest Sanity v2
Screenshot 2022-11-14 at 18 37 56

On mobile, when I focus on this field, it opens the keyboard with letters, numbers, and symbols. Far from optimal, but I still could find the decimal symbols and fill those numbers out.

When I clone my CMS using Sanity v3, I notice that the same field now renders in type number (great), however, it has a mode called numeric:

Screenshot 2022-11-14 at 18 37 32

And that's not right for a number field.

That's because, according to MDN:

"Numeric" input keyboard, but only requires the digits 0–9. Devices may or may not show a minus key.

I think you can guess that now using Sanity v3 when I open on mobile, it only opens the numeric keyboard, and I cannot type decimals:

That's really hard because every time I have to type something on mobile, I have to do it wrong, open it on my PC and fix those values.

To Reproduce

  1. creates a sanity project using v3;
  2. defines a schema with a field type number;
  3. run the server;
  4. open sanity desk on your mobile (I tried on iOS, but I believe it would also affect android. Emulator might work also);
  5. See the numeric field

Expected behavior

I expect when I define a numeric field, it uses inputmode="decimal" so the right keyboard layout could be invoked.

Screenshots

On the problem description

Which versions of Sanity are you using?

On my v3 project:

@sanity/cli (global)  3.0.0-rc.2 (latest: 2.35.0)
sanity                3.0.0-rc.2 (latest: 2.33.2)

On my v2 project:

@sanity/cli             2.33.3 (latest: 2.35.0)
@sanity/base            2.33.3 (latest: 2.35.0)
@sanity/cli             2.33.3 (latest: 2.35.0)
@sanity/core            2.33.3 (latest: 2.35.0)
@sanity/data-aspects    2.33.2 (up to date)
@sanity/default-layout  2.33.3 (latest: 2.35.0)
@sanity/default-login   2.33.3 (latest: 2.35.0)
@sanity/desk-tool       2.33.3 (latest: 2.35.1)
@sanity/form-builder    2.33.3 (latest: 2.35.0)
@sanity/types           2.33.2 (latest: 2.35.0)
@sanity/vision          2.33.3 (latest: 2.35.0)

What operating system are you using?

iOS 16

Which versions of Node.js / npm are you running?

  • pnpm: v7.14.0
  • node: v16.17.0

Additional context

@bjoerge
Copy link
Member

bjoerge commented Nov 22, 2022

Fixed by #3867. Thanks!

@bjoerge bjoerge closed this as completed Nov 22, 2022
@github-actions
Copy link
Contributor

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants