Skip to content

Expose onBlur in ComboboxControl #68874

Open
dhananjaykuber wants to merge 2 commits intoWordPress:trunkfrom
dhananjaykuber:feat/expose-onblur-in-combobox
Open

Expose onBlur in ComboboxControl #68874
dhananjaykuber wants to merge 2 commits intoWordPress:trunkfrom
dhananjaykuber:feat/expose-onblur-in-combobox

Conversation

@dhananjaykuber
Copy link
Copy Markdown
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
@github-actions
Copy link
Copy Markdown

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 <dhananjaykuber@git.wordpress.org>
Co-authored-by: drazenbebic <drazenbebic@git.wordpress.org>

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