Skip to content

Commit 7f0bd6a

Browse files
authored
fix(ui5-popover, ui5-dialog): do not render empty headers (#2770)
Fixes: #2694
1 parent fa03eae commit 7f0bd6a

File tree

4 files changed

+18
-12
lines changed

4 files changed

+18
-12
lines changed

packages/main/src/Dialog.hbs

+12-10
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
{{>include "./Popup.hbs"}}
22

33
{{#*inline "beforeContent"}}
4-
<header
5-
class="ui5-popup-header-root"
6-
id="ui5-popup-header"
7-
@mousedown="{{_onDragMouseDown}}">
8-
{{#if header.length }}
9-
<slot name="header"></slot>
10-
{{else}}
11-
<h2 class="ui5-popup-header-text">{{headerText}}</h2>
12-
{{/if}}
13-
</header>
4+
{{#if _displayHeader }}
5+
<header
6+
class="ui5-popup-header-root"
7+
id="ui5-popup-header"
8+
@mousedown="{{_onDragMouseDown}}">
9+
{{#if header.length }}
10+
<slot name="header"></slot>
11+
{{else}}
12+
<h2 class="ui5-popup-header-text">{{headerText}}</h2>
13+
{{/if}}
14+
</header>
15+
{{/if}}
1416
{{/inline}}
1517

1618
{{#*inline "afterContent"}}

packages/main/src/Dialog.js

+4
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,10 @@ class Dialog extends Popup {
203203
return "flex";
204204
}
205205

206+
get _displayHeader() {
207+
return this.header.length || this.headerText;
208+
}
209+
206210
show() {
207211
super.show();
208212
this._center();

packages/main/src/Popover.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ class Popover extends Popup {
659659
* Hook for descendants to hide header.
660660
*/
661661
get _displayHeader() {
662-
return true;
662+
return this.header.length || this.headerText;
663663
}
664664

665665
/**

packages/main/src/ResponsivePopover.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ class ResponsivePopover extends Popover {
163163
}
164164

165165
get _displayHeader() {
166-
return this._isPhone || !this.contentOnlyOnDesktop;
166+
return (this._isPhone || !this.contentOnlyOnDesktop) && super._displayHeader;
167167
}
168168

169169
get _displayFooter() {

0 commit comments

Comments
 (0)