Skip to content

useTextField should block change events during composition #8506

Closed
@qmhc

Description

@qmhc

Provide a general summary of the feature here

I think useTextField should block change events during composition by default.

This behavior doesn’t affect input in non-compositional languages like English. Moreover, in communities that use compositional input methods (such as Chinese), it’s already a widely accepted convention that change events shouldn’t fire during composition — all major component libraries handle this case. That’s why I believe adding this behavior would further improve the usability of useTextField.

🤔 Expected Behavior?

Blocks change events during composition.

😯 Current Behavior

Will dispatch change events during composition.

💁 Possible Solution

We can use a ref to track the composition state and block change events during composition.

🔦 Context

As I mentioned above, when working with languages like Chinese and Japanese, unintended change events are triggered during composition. To filter them out, I have to add composition-related handling every time.

However, if this becomes the default behavior, the user experience in such scenarios would improve significantly.

💻 Examples

https://stackblitz.com/edit/vitejs-vite-jffqgkfu?file=src%2FInput2.tsx

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions