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

[NumberField] Allow the character 'e' as a shortcut for scientific notation #414

Open
Xen0o2 opened this issue May 24, 2024 · 3 comments
Open
Labels
component: number field This is the name of the generic UI component, not the React module! new feature New feature or request waiting for 👍 Waiting for upvotes

Comments

@Xen0o2
Copy link

Xen0o2 commented May 24, 2024

Related page

https://master--base-ui.netlify.app/base-ui/react-number-field/

Kind of issue

Other

Issue description

Allow inputting the character e as a shortcut for scientific notation

Context

Writing non-numeric authorized character in number input

Search keywords: number input base-ui

Search keywords:

@Xen0o2 Xen0o2 added status: waiting for maintainer These issues haven't been looked at yet by a maintainer support: docs-feedback Feedback from documentation page labels May 24, 2024
@oliviertassinari oliviertassinari transferred this issue from mui/material-ui May 24, 2024
@oliviertassinari oliviertassinari added component: number field This is the name of the generic UI component, not the React module! and removed component: number field This is the name of the generic UI component, not the React module! labels May 24, 2024
@atomiks
Copy link
Contributor

atomiks commented May 28, 2024

In the new Number Field in v1.0.0-alpha.1, we only allow - and ., and + if the formatting permits it.

I believe e isn't allowed at all, even if you've set scientific as a formatting option. However, I understand it's useful to use scientific notation as a shortcut (e.g. it's easier to input 1e9 than 1000000000, and I do use this feature in Google Sheets), so we can look into supporting this.

@atomiks atomiks removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label May 28, 2024
@Xen0o2
Copy link
Author

Xen0o2 commented May 28, 2024

Would be a cool feature, and above all in the component introduction you're talking about the fact that e is authorized.

image

And the . character is not allowed either.

@atomiks
Copy link
Contributor

atomiks commented May 28, 2024

The one on the live website underwent an API rewrite in our new alpha version (@base_ui/[email protected]), so it's been recently replaced.

You can take a look at the new one's docs here. It allows . (including , if the locale permits), and + if formatting permits, but not e yet as I mentioned above.

@michaldudak michaldudak changed the title Can't write "e", "+" or "-" in Unstable_NumberInput BaseUI [NumberField] Can't write "e", "+" or "-" Sep 20, 2024
@mj12albert mj12albert removed their assignment Dec 4, 2024
@mj12albert mj12albert added new feature New feature or request waiting for 👍 Waiting for upvotes and removed support: docs-feedback Feedback from documentation page labels Dec 4, 2024
@mj12albert mj12albert changed the title [NumberField] Can't write "e", "+" or "-" [NumberField] Allow the character 'e' as a shortcut for scientific notation Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: number field This is the name of the generic UI component, not the React module! new feature New feature or request waiting for 👍 Waiting for upvotes
Projects
None yet
Development

No branches or pull requests

4 participants