Skip to content
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

Expose onBlur in ComboboxControl #68874

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

dhananjaykuber
Copy link
Contributor

Fixes #56226

What?

Expose onBlur prop in ComboboxControl component to allow handling blur events.

Why?

Fixes #56226 where users need to reset pagination and search state when ComboboxControl loses focus, especially for AJAX-loaded data.

How?

  1. Added onBlur prop to ComboboxControlProps interface
  2. Modified onBlur handler to call parent's onBlur callback
  3. Maintained existing blur functionality

Testing Instructions

<ComboboxControl
  onBlur={() => setPage(1)}
  // other props
/>

Screenshots or screencast

N/A - Functionality change only

@dhananjaykuber dhananjaykuber changed the title Feat/expose onblur in combobox Expose onBlur in ComboboxControl Jan 24, 2025
@dhananjaykuber dhananjaykuber marked this pull request as ready for review January 24, 2025 12:12
Copy link

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: dhananjaykuber <[email protected]>
Co-authored-by: drazenbebic <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@t-hamano t-hamano added [Type] Enhancement A suggestion for improvement. [Package] Components /packages/components labels Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose onBlur in ComboboxControl
2 participants