{this.showStartSeparator && (
)}
- >
+
@@ -138,27 +142,29 @@ export default function ShellBarTemplate(this: ShellBar) {
+
-
+ {!(this.hasSelfCollapsibleSearch || this.hideSearchButton) && (
+
+ )}
>
)}
{this.hasAssistant && (
diff --git a/packages/fiori/src/themes/ShellBar.css b/packages/fiori/src/themes/ShellBar.css
index c626ddf21a53..d93fd7dee73b 100644
--- a/packages/fiori/src/themes/ShellBar.css
+++ b/packages/fiori/src/themes/ShellBar.css
@@ -352,13 +352,19 @@ slot[name="profile"] {
.ui5-shellbar-overflow-container-right-inner {
display: flex;
- justify-content: flex-end;
+ flex-grow: 1;
+}
+
+.ui5-shellbar-content-items {
+ display: flex;
+ justify-content: center;
align-items: center;
flex-grow: 1;
+ /* max-content prevents the container from overflowing
+ which is needed for the responsive logic */
min-width: max-content;
}
-
.ui5-shellbar-spacer {
flex-grow: 1;
height: 1px;
diff --git a/packages/fiori/test/pages/ShellBar_evolution.html b/packages/fiori/test/pages/ShellBar_evolution.html
index a6ff448a8c9b..fa879cae34d3 100644
--- a/packages/fiori/test/pages/ShellBar_evolution.html
+++ b/packages/fiori/test/pages/ShellBar_evolution.html
@@ -134,9 +134,7 @@
PR9
-
- Instructions
-
+

@@ -179,9 +177,10 @@
PR9
-
- Instructions
-
+
+
+
+

@@ -279,6 +278,42 @@
displayMenuOpener(hiddenItems.indexOf(btnOpenBasicDynamic) > -1);
});
+ function handleSearchEvent(e) {
+ if (e.target.collapsed) {
+ e.target.collapsed = false;
+ } else {
+ if (!e.target.value) {
+ e.target.collapsed = true;
+ }
+ }
+ }
+ const searches = Array.from(document.querySelectorAll('ui5-search'));
+ searches.forEach((searchField) => {
+ searchField.addEventListener('ui5-search', handleSearchEvent);
+ });
+
+ ["focus", "blur", "input"].forEach((event) => {
+ customSearchInput.addEventListener(event, () => {
+ shellbar_hide_search.disableAutoSearchField =
+ customSearchInput.value || customSearchInput === document.activeElement;
+ });
+ });
+
+ shellbar_hide_search.addEventListener('ui5-search-field-toggle', async (e) => {
+ shellbar_hide_search.hideSearchButton = e.detail.expanded;
+ });
+
+ shellbar_hide_search.addEventListener('ui5-search-button-click', async (e) => {
+ await window["sap-ui-webcomponents-bundle"].renderFinished();
+ customSearchInput.focus();
+ });
+
+ customSearchClose.addEventListener('click', async () => {
+ shellbar_hide_search.showSearchField = false;
+ shellbar_hide_search.hideSearchButton = false;
+ await window["sap-ui-webcomponents-bundle"].renderFinished();
+ shellbar_hide_search.searchButtonDomRef.focus();
+ });