Skip to content

Many events prevented when using useNumberField. #2803

@ghost

Description

🐛 Bug Report

I am using the useNumberField hook inside a form.

Using the hook seems to prevent a lot of events.
Here are some examples:

Keyboard shortcut Expected behaviour
Ctrl + Backspace delete from the caret to the nearest visual line break before the caret position
Ctrl + Del delete from the caret to the nearest visual line break after the caret position
home Go to the beginning of the current line
end Go to the end of the current line

All these events seem to be prevented in the NumberField, but not in a TextField.

🤔 Expected Behavior

Those events should not be prevented.

😯 Current Behavior

Those events are prevented.

💁 Possible Solution

🔦 Context

Possibly related issue; #2802 (They might be related, but I didn't know, so I created this one as well.)

💻 Code Sample

Codesandbox reproduction

🌍 Your Environment

Software Version(s)
react-spectrum 3.9.0
Browser
Operating System

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions