mui / mui/base-ui

[number field] Don't focus the input when clicking buttons

Open
#2,710 5 comments 0 reactions 0 assignees View on GitHub
component: number field type: enhancement
Dominant language
TypeScript
Stars
10.9k
Forks
543
Avg merge
1d 20h
Merged PRs (30d)
101

Description

# Feature request

## Summary

The number field component currently puts focus on the input element whenever you click the decrement or the increment buttons. It would be nice if this was configurable.

## Motivation

In my use case, the decrement and increment buttons are the primary way to affect the value of the number field. It's still possible to type in the input itself, but it's a rarer action. As such, I don't want to put focus on the input every time you click the button.

---

It seems like this is triggered through the ref to the input element, so overriding this behavior gets a little messy. I could for instance not use the NumberField.Input element, but then I lose out on other behavior.

It would be nice to be able to disable this.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.