Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(components): fix setting contentDensity styles #2094

Merged
merged 1 commit into from
Aug 17, 2020
Merged
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/base/src/StaticAreaItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class StaticAreaItem {
this._rendered = true;
}

this._updateContentDensity(this.ui5ElementContext.isCompact);
this.ui5ElementContext.constructor.render(renderResult, this.staticAreaItemDomRef.shadowRoot, stylesToAdd, { eventContext: this.ui5ElementContext });
}

Expand Down
2 changes: 0 additions & 2 deletions packages/fiori/src/ShellBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,6 @@ class ShellBar extends UI5Element {
this._updateClonedMenuItems();

if (this.hasMenuItems) {
this.updateStaticAreaItemContentDensity();
const menuPopover = await this._getMenuPopover();
menuPopover.openBy(this.shadowRoot.querySelector(".ui5-shellbar-menu-button"));
}
Expand Down Expand Up @@ -635,7 +634,6 @@ class ShellBar extends UI5Element {

_toggleActionPopover() {
const overflowButton = this.shadowRoot.querySelector(".ui5-shellbar-overflow-button");
this.updateStaticAreaItemContentDensity();
this.overflowPopover.openBy(overflowButton);
}

Expand Down
1 change: 0 additions & 1 deletion packages/main/src/ComboBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,6 @@ class ComboBox extends UI5Element {
}

_openRespPopover() {
this.updateStaticAreaItemContentDensity();
this.responsivePopover.open(this);
}

Expand Down
1 change: 0 additions & 1 deletion packages/main/src/DatePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,6 @@ class DatePicker extends UI5Element {
if (this.isOpen()) {
this.closePicker();
} else if (this._canOpenPicker()) {
this.updateStaticAreaItemContentDensity();
this.openPicker();
}
}
Expand Down
2 changes: 0 additions & 2 deletions packages/main/src/Input.js
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,6 @@ class Input extends UI5Element {
if (!this.firstRendering && !isPhone() && this.Suggestions) {
const shouldOpenSuggestions = this.shouldOpenSuggestions();

this.updateStaticAreaItemContentDensity();
this.Suggestions.toggle(shouldOpenSuggestions, {
preventFocusRestore: !this.hasSuggestionItemSelected,
});
Expand Down Expand Up @@ -657,7 +656,6 @@ class Input extends UI5Element {

_click(event) {
if (isPhone() && !this.readonly && this.Suggestions) {
this.updateStaticAreaItemContentDensity();
this.Suggestions.open(this);
this.isRespPopoverOpen = true;
}
Expand Down
3 changes: 0 additions & 3 deletions packages/main/src/MultiComboBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,6 @@ class MultiComboBox extends UI5Element {
if (filteredItems.length === 0) {
this.allItemsPopover.close();
} else {
this.updateStaticAreaItemContentDensity();
this.allItemsPopover.open(this);
}
}
Expand Down Expand Up @@ -514,13 +513,11 @@ class MultiComboBox extends UI5Element {
}

_toggleRespPopover() {
this.updateStaticAreaItemContentDensity();
this.allItemsPopover.toggle(this);
}

_click(event) {
if (isPhone() && !this.readonly && !this._showMorePressed) {
this.updateStaticAreaItemContentDensity();
this.allItemsPopover.open(this);
}

Expand Down
2 changes: 0 additions & 2 deletions packages/main/src/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,6 @@ class Select extends UI5Element {
return;
}

this.updateStaticAreaItemContentDensity();

if (this._isPickerOpen) {
this.responsivePopover.close();
} else {
Expand Down
8 changes: 8 additions & 0 deletions packages/main/test/pages/TimePicker.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@
</ui5-time-picker>
<ui5-button id="testBtn">btn for testing</ui5-button>


<section class="ui5-content-density-compact">
<h3>TimePicker in Compact</h3>
<div>
<ui5-time-picker></ui5-time-picker>
</div>
</section>

<script>
var counter = 0;
timepickerChange.addEventListener("ui5-change", function() {
Expand Down