Skip to content

feat: Prevent onChange from firing in TextFields while user is typing via IME #8519

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 10, 2025

Conversation

LFDanLu
Copy link
Member

@LFDanLu LFDanLu commented Jul 10, 2025

Closes #8506

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

🧢 Your Project:

RSP

LFDanLu added 2 commits July 9, 2025 17:08
this is for IMEs, we only want onChange to fire once the user has confirmed the final word/phrase they wanna enter
return;
}

onChangeProp && onChangeProp(val);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
onChangeProp && onChangeProp(val);
onChangeProp?.(val);

@rspbot
Copy link

rspbot commented Jul 10, 2025

deleting IME input is essentially cancelling it so it shouldnt trigger another onChange
@LFDanLu LFDanLu marked this pull request as ready for review July 10, 2025 00:23
@rspbot
Copy link

rspbot commented Jul 10, 2025

@rspbot
Copy link

rspbot commented Jul 10, 2025

Copy link
Member

@reidbarber reidbarber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@LFDanLu LFDanLu added this pull request to the merge queue Jul 10, 2025
Merged via the queue into main with commit 769d725 Jul 10, 2025
31 checks passed
@LFDanLu LFDanLu deleted the 8506 branch July 10, 2025 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

useTextField should block change events during composition
4 participants