fix(ui5-shellbar): fix search-button-click event and getSearchButtonDomRef with ui5-shellbar-search#13843
Open
plamenivanov91 wants to merge 1 commit into
Open
fix(ui5-shellbar): fix search-button-click event and getSearchButtonDomRef with ui5-shellbar-search#13843plamenivanov91 wants to merge 1 commit into
plamenivanov91 wants to merge 1 commit into
Conversation
…omRef with ui5-shellbar-search Both issues stem from the new ui5-shellbar-search path bypassing handleSearchButtonClick entirely ? the controller called setSearchState directly, which toggled the field but never fired the event. search-button-click not fired (Issue 1) - Add handleSearchButtonClick callback to ShellBarSearchConstructorParams and wire it up via getSearchDeps(). - Route onSearch in the ShellBarSearch controller through handleSearchButtonClick() instead of calling setSearchState directly, so the event fires consistently and preventDefault() is respected. - Resolve the targetRef in handleSearchButtonClick from the ui5-shellbar-search shadow root (.ui5-shell-search-field-button) when isSelfCollapsibleSearch, so event.detail.targetRef is never null. getSearchButtonDomRef returns null (Issue 2) - Add getSearchButtonDomRef() to ShellBarSearch (the custom element), querying .ui5-shell-search-field-button from its own shadow root. - Delegate from ShellBar.getSearchButtonDomRef() to the component method when isSelfCollapsibleSearch; legacy data-ui5-stable path is unchanged. Returns null when the search is expanded (button not in DOM) ? correct. Tests (ShellBar.cy.tsx) - fires search-button-click with non-null targetRef when ui5-shellbar-search is used. - getSearchButtonDomRef returns the toggle button when collapsed. Sample (ShellBar.html) - Added a ui5-shellbar-search section with live event output and a button to call getSearchButtonDomRef() and display the result. SNOW: DINC0975247 SNOW: DINC0975256
|
🚀 Deployed on https://pr-13843--ui5-webcomponents-preview.netlify.app |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Both issues stem from the new ui5-shellbar-search path bypassing handleSearchButtonClick entirely ? the controller called setSearchState directly, which toggled the field but never fired the event.
search-button-click not fired (Issue 1)
getSearchButtonDomRef returns null (Issue 2)
Tests (ShellBar.cy.tsx)
Sample (ShellBar.html)
SNOW: DINC0975247
SNOW: DINC0975256