Bug reportNov 19, 2026· 0:13· 13 views
Mantine NumberInput: ArrowUp/Down increments value even when nativeEvent.defaultPrevented is true
0:13 total
Comments · 0
Be the first to comment.
Bug reportby SceneRecap AI
mediumNumberInput keydown handler for ArrowUp and ArrowDown stepping. It should return early when event.nativeEvent.defaultPrevented (or event.defaultPrevented) is true.
os: macOSdpr: 1page: /core/number-inputlocale: en-USbrowser: Chromium 151.0.7922.34timezone: Europe/Berlinviewport: 1280x720mantine_version: v9.8.1
Repro steps
- 1.Open the Mantine NumberInput docs page at /core/number-input. The demo input labeled 'Input label' shows the value 50.
- 2.Attach a native keydown listener on the input that calls e.preventDefault() for ArrowUp and ArrowDown. The overlay says this listener fires before the React root.
- 3.Click the spinbutton 'Number input' to focus it.
- 4.Press ArrowUp 3 times. The console message at 8.7s reports 3×ArrowUp. The key presses are not in the event log.
Expected
NumberInput checks nativeEvent.defaultPrevented and skips stepping. The value stays at 50.
Actual
The value steps from 50 to 52 by 7.0s and to 53 by 9.0s. A console error at 8.7s and an error toast at 9.0s report value 53 when 50 was expected.
Evidence
visualDemo input holds the value 50 before any interaction.
visualOverlay shows the native keydown listener calling preventDefault for ArrowUp and ArrowDown. The note says NumberInput should stop stepping if nativeEvent.defaultPrevented.
visualInput is focused after the click and still shows 50.
visualInput value has changed to 52 even though the listener prevented the keydown.
consolemantine#9442: value after 3×ArrowUp with preventDefault = 53 (expected 50)
visualInput shows 53. Red toast reads 'Value = 53, expected 50' and 'Stepped 3× despite nativeEvent.defaultPrevented === true'.
visualValue stays at 53 and the error toast is still visible.
Issue markdown (copy-paste ready)
## Summary
Mantine NumberInput (v9.8.1) still steps its value on ArrowUp when a native keydown listener has already called `preventDefault()`. The component should respect `nativeEvent.defaultPrevented`.
## Environment
- Browser: Chromium 151.0.7922.34
- OS: macOS
- Viewport: 1280x720, DPR 1
- Mantine: v9.8.1
- Page: /core/number-input
## Steps to reproduce
1. Open /core/number-input. The demo input shows `50` (0.0s).
2. Attach a native listener on the input (3.0s):
```js
input.addEventListener('keydown', e => {
if (e.key==='ArrowUp'||e.key==='ArrowDown') e.preventDefault();
})
```
3. Click the spinbutton 'Number input' to focus it (4.8s).
4. Press ArrowUp 3 times. The console message at 8.7s reports 3×ArrowUp.
## Expected
No stepping happens because the native event is already default-prevented. The value stays `50`.
## Actual
The value steps to `52` (7.0s) and then `53` (9.0s).
## Evidence
- 0.0s: input value is 50.
- 3.0s: overlay shows the native preventDefault listener, which fires before the React root.
- 4.8s: input focused, value still 50.
- 7.0s: value is 52 (first bad moment).
- 8.7s: console error `mantine#9442: value after 3×ArrowUp with preventDefault = 53 (expected 50)`.
- 9.0s: value is 53. Error toast: 'Stepped 3× despite nativeEvent.defaultPrevented === true'.
- 11.0s: value remains 53.
## Suggested area
NumberInput keydown handling for ArrowUp and ArrowDown. Bail out of stepping when `event.nativeEvent.defaultPrevented` is true.
*Recorded with SceneRecap.*Your recordings could explain themselves too.
Free plan · silent recordings welcome · bug reports included.
Try SceneRecap free →