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

[number input] Mobile focus mode #39275

Open
oliviertassinari opened this issue Oct 3, 2023 · 6 comments
Open

[number input] Mobile focus mode #39275

oliviertassinari opened this issue Oct 3, 2023 · 6 comments
Assignees
Labels
bug 🐛 Something doesn't work component: number field This is the name of the generic UI component, not the React module! design This is about UI or UX design, please involve a designer

Comments

@oliviertassinari
Copy link
Member

oliviertassinari commented Oct 3, 2023

Steps to reproduce 🕹

Link to live example:

Steps:

  1. Open https://mui.com/base-ui/react-number-input/#minimum-and-maximum on mobile
  2. Press on one of the buttons
Screen.Recording.2023-10-03.at.02.06.13.mov

Current behavior 😯

See how the input is focused

Expected behavior 🤔

It's not clear to me that we should focus the input. On mobile, it's quite annoying to see the virtual keyboard show when using the button is enough to set the expected value.

It doesn't seem that I'm the only one to be annoyed:

  1. Example with https://www.figma.com/purchase-organization/details
Screen.Recording.2023-10-03.at.02.09.47.mov
  1. On https://react-spectrum.adobe.com/react-aria/NumberField.html the input is not focused on mobile

Your environment 🌎

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.
@oliviertassinari oliviertassinari added status: waiting for maintainer These issues haven't been looked at yet by a maintainer design This is about UI or UX design, please involve a designer component: number field This is the name of the generic UI component, not the React module! labels Oct 3, 2023
@Aditya-Chaurasia11
Copy link

can you please assign this to me?

@Visbhavesh
Copy link

assign it to me

@asdotdev
Copy link

asdotdev commented Oct 3, 2023

This same behaviour occurs in all places where NumberInput(Unstable_NumberInput) is being used as a Mui-focused class name is appending in MuiNumberInput-root on button press too and not only on input press.

@oliviertassinari oliviertassinari added the bug 🐛 Something doesn't work label Oct 3, 2023
@omagr
Copy link

omagr commented Oct 3, 2023

@mj12albert

I hope this message finds you well. I was wondering if you're currently working on this particular issue. If not, I would greatly appreciate it if you could consider assigning it to me.

@akshayw1
Copy link

akshayw1 commented Oct 4, 2023

Could you pls assign it to me?

@mj12albert mj12albert removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Nov 9, 2023
@dankgen-tobias
Copy link

dankgen-tobias commented Jun 28, 2024

Meanwhile you can use the hook https://mui.com/base-ui/react-number-input/#hook and override the onMouseDown event on the increment/decrement button. Then it won't focus anymore, this is because in the code it says

const handleStepperButtonMouseDown = event => {
    event.preventDefault();
    if (inputRef.current) {
      inputRef.current.focus();
    }
  };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: number field This is the name of the generic UI component, not the React module! design This is about UI or UX design, please involve a designer
Projects
None yet
Development

No branches or pull requests

8 participants