Skip to content

TextField: No possibility to pass props into input #8965

@artola

Description

@artola

Provide a general summary of the issue here

Change done to TextField by changing the InputContext by FieldInputContext is a breaking change.
Before it was possible to pass props and ref to the input element, now it is not possible.

[props, inputRef as unknown] = useContextProps(props, inputRef, FieldInputContext);

https://github.com/adobe/react-spectrum/blame/4a37eb89b25b2cdde0fa44b2cb082b3bf2809ac2/packages/react-aria-components/src/TextField.tsx

🤔 Expected Behavior?

I would like a way to pass a prop (e.g., an event handler) directly to the input."

😯 Current Behavior

RAC 1.11.0 is OK. Since RAC 1.12.0 the TextField does not consume InputContext and seems not possible to pass onBeforeInput to the input element.

💁 Possible Solution

have both context InputContext and FieldInputContext ?

🔦 Context

No response

🖥️ Steps to Reproduce

RAC 1.12 contains

Version

RAC 1.12.1

What browsers are you seeing the problem on?

Chrome

If other, please specify.

No response

What operating system are you using?

macOS

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions