Skip to content

Commit

Permalink
feat(ui5-popover, ui5-dialog): add noHorizontalScrolling and noVertic…
Browse files Browse the repository at this point in the history
…alScrolling properties
  • Loading branch information
TeodorTaushanov committed Sep 10, 2024
1 parent ae7d8ce commit 9edb021
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 12 deletions.
8 changes: 0 additions & 8 deletions packages/main/src/Popover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,6 @@ class Popover extends Popup {
@property({ type: Boolean })
allowTargetOverlap = false;

/**
* Defines whether the content is scrollable.
* @default false
* @private
*/
@property({ type: Boolean })
disableScrolling = false;

/**
* Sets the X translation of the arrow
* @private
Expand Down
22 changes: 22 additions & 0 deletions packages/main/src/Popup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,28 @@ abstract class Popup extends UI5Element {
@property({ type: Boolean })
preventInitialFocus = false;

/**
* Indicates whether the component has its own horizontal scroll when the content
* exceeds the content area. However, if a scrollable component is present
* within the content area, this property must be set to `true` to disable
* the default scrolling.
* @default false
* @since 2.2.0
*/
@property({ type: Boolean })
noHorizontalScrolling = false;

/**
* Indicates whether the component has its own vertical scroll when the content
* exceeds the content area. However, if a scrollable component is present
* within the content area, this property must be set to `true` to disable
* the default scrolling.
* @default false
* @since 2.2.0
*/
@property({ type: Boolean })
noVerticalScrolling = false;

/**
* Indicates if the element is the top modal popup
*
Expand Down
8 changes: 6 additions & 2 deletions packages/main/src/themes/PopupsCommon.css
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,12 @@
display: none;
}

:host([no-scrolling]) .ui5-popup-content {
overflow: hidden;
:host([no-horizontal-scrolling]) .ui5-popup-content {
overflow-x: hidden;
}

:host([no-vertical-scrolling]) .ui5-popup-content {
overflow-y: hidden;
}

/*** Responsive paddings for the content***/
Expand Down
11 changes: 9 additions & 2 deletions packages/main/test/pages/Popover.html
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,15 @@
Open Popover ACC role - None
</ui5-button>

<ui5-popover placement="Bottom" id="acc-role-popover" header-text="Test ACC world" accessible-role="AlertDialog">
<ui5-list id="bigList2"></ui5-list>
<ui5-popover placement="Bottom"
id="acc-role-popover"
header-text="Test ACC world"
no-vertical-scrolling
accessible-role="AlertDialog">
<div class="popoverContent">
<ui5-title level="H2">Title</ui5-title>
<ui5-list class="popoverContentList" id="bigList2"></ui5-list>
</div>
</ui5-popover>

<ui5-popover placement="Bottom" id="acc-role-popover2" header-text="Test ACC world" accessible-role="None">
Expand Down
11 changes: 11 additions & 0 deletions packages/main/test/pages/styles/Popover.css
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,15 @@ ui5-date-picker,

#divOpenAndScroll > div {
height: 2000px;
}

.popoverContent {
display: flex;
flex-direction: column;
height: 100%;
}

.popoverContentList {
flex: 1;
min-height: 0;
}

0 comments on commit 9edb021

Please sign in to comment.