Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/fiori/src/Search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ type SearchEventDetails = {
* @public
* @since 2.9.0
* @experimental
* @csspart search-popover - Used to style the suggestions popover content
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I would strip search from the name as the component is Search, so maybe popover, dropdown, or suggestion-popover

*/
@customElement({
tag: "ui5-search",
Expand Down
1 change: 1 addition & 0 deletions packages/fiori/src/SearchPopoverTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default function SearchPopoverTemplate(this: Search, headerTemplate?: Jsx
onClose={this._handleClose}
onBeforeClose={this._handleBeforeClose}
onBeforeOpen={this._handleBeforeOpen}
exportparts="content: search-popover"
class={{
"ui5-search-popover": true,
"ui5-search-popover-phone": isPhone(),
Expand Down
1 change: 1 addition & 0 deletions packages/fiori/src/themes/Search.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
.ui5-search-popover::part(content) {
padding: 0;
box-shadow: none;
max-height: var(--_ui5_search_popover_max_height);
}

:host([loading]) .ui5-search-popover main {
Expand Down
1 change: 1 addition & 0 deletions packages/fiori/src/themes/base/Search-parameters.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
:host {
--_ui5_search_item_vertical_padding: 1rem;
--_ui5_search_byline_vertical_padding: .5rem;
--_ui5_search_popover_max_height: 39rem;
}

@container style(--ui5_content_density: compact) {
Expand Down
22 changes: 21 additions & 1 deletion packages/fiori/test/pages/Search.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
.last {
padding-bottom: 2rem;
}

#search-custom-max-height::part(search-popover) {
max-height: 10rem;
}
</style>

<script src="%VITE_BUNDLE_PATH%" type="module"></script>
Expand Down Expand Up @@ -258,7 +262,7 @@
<ui5-search id="search-with-loading" show-clear-icon placeholder="Search..."></ui5-search>
</div>

<div class="container last">
<div class="container">
<ui5-label>Search with Suggestions with long group header text (wrapping)</ui5-label>
<ui5-search id="search" show-clear-icon placeholder="Placeholder">
<ui5-search-item-group header-text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat. Duis semper. Duis arcu massa, scelerisque vitae, consequat in, pretium a, enim. Pellentesque congue. Ut in risus volutpat libero pharetra tempor. Cras vestibulum bibendum augue. Praesent egestas leo in pede. Praesent blandit odio eu enim. Pellentesque sed dui ut augue blandit sodales. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam nibh. Mauris ac mauris sed pede pellentesque fermentum. Maecenas adipiscing ante non diam sodales hendrerit.">
Expand All @@ -268,6 +272,22 @@
</ui5-search>
</div>

<div class="container last">
<ui5-label>Search with custom popover max-height (10rem) using CSS part</ui5-label>
<ui5-search id="search-custom-max-height" show-clear-icon placeholder="Start typing ...">
<ui5-search-item text="Item 1" icon="history"></ui5-search-item>
<ui5-search-item text="Item 2" icon="history"></ui5-search-item>
<ui5-search-item text="Item 3" icon="history"></ui5-search-item>
<ui5-search-item text="Item 4" icon="history"></ui5-search-item>
<ui5-search-item text="Item 5" icon="history"></ui5-search-item>
<ui5-search-item text="Item 6" icon="history"></ui5-search-item>
<ui5-search-item text="Item 7" icon="history"></ui5-search-item>
<ui5-search-item text="Item 8" icon="history"></ui5-search-item>
<ui5-search-item text="Item 9" icon="history"></ui5-search-item>
<ui5-search-item text="Item 10" icon="history"></ui5-search-item>
</ui5-search>
</div>

<script>
const search = document.getElementById('search');
const scopedSearch = document.getElementById('scoped-search');
Expand Down
Loading