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(ui5-dialog): fix content stretching on Safari #3068

Merged
merged 2 commits into from
Mar 31, 2021
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
49 changes: 33 additions & 16 deletions packages/fiori/test/pages/Wizard_test.html
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
</ui5-wizard>

<ui5-dialog id="dialog" stretch header-heading="Wizard">
<ui5-wizard>
<ui5-wizard id="wizInDialog">
<ui5-wizard-step icon="sap-icon://product" selected heading="Product type">
<div style="display: flex; min-height: 200px; flex-direction: column;">
<ui5-title>1. Product Type</ui5-title><br>
Expand All @@ -190,7 +190,7 @@
<ui5-input></ui5-input>
</div>

<ui5-button design="Emphasized">Step 2</ui5-button>
<ui5-button id="toStep2InDialog" design="Emphasized">Step 2</ui5-button>
</ui5-wizard-step>

<ui5-wizard-step heading="Product Information">
Expand Down Expand Up @@ -231,7 +231,7 @@
</div>
</div>

<ui5-button design="Emphasized">Step 3</ui5-button>
<ui5-button id="toStep3InDialog" design="Emphasized">Step 3</ui5-button>
</ui5-wizard-step>

<ui5-wizard-step heading="Options">
Expand Down Expand Up @@ -272,7 +272,7 @@
</div>
</div>

<ui5-button design="Emphasized">Step 4</ui5-button>
<ui5-button id="toStep4InDialog" design="Emphasized">Step 4</ui5-button>
</ui5-wizard-step>

<ui5-wizard-step heading="Pricing">
Expand Down Expand Up @@ -311,6 +311,7 @@

<script>
var wiz = document.getElementById("wizTest");
var wizInDialog = document.getElementById("wizInDialog");
var counter = 0;
wiz.addEventListener("ui5-selection-change", function (event) {
console.log(event.detail.selectedStep);
Expand All @@ -319,37 +320,53 @@
});

toStep2.addEventListener("click", function () {
deselectAll();
setStep(1);
deselectAll(wiz);
setStep(1, wiz);
});

toStep22.addEventListener("click", function () {
deselectAll();
setStep(1);
deselectAll(wiz);
setStep(1, wiz);
});

toStep3.addEventListener("click", function () {
deselectAll();
setStep(2);
deselectAll(wiz);
setStep(2, wiz);
});

toStep4.addEventListener("click", function () {
deselectAll();
setStep(3);
deselectAll(wiz);
setStep(3, wiz);
});

toStep2InDialog.addEventListener("click", function () {
deselectAll(wizInDialog);
setStep(1, wizInDialog);
});

toStep3InDialog.addEventListener("click", function () {
deselectAll(wizInDialog);
setStep(2, wizInDialog);
});

toStep4InDialog.addEventListener("click", function () {
deselectAll(wizInDialog);
setStep(3, wizInDialog);
});

function deselectAll() {
function deselectAll(wiz) {
Array.from(wiz.children).forEach(function(step) {
step.selected = false;
});
}

function setStep(idx) {
const step = getStep(idx);
function setStep(idx, wiz) {
const step = getStep(idx, wiz);
step.selected = true;
step.disabled = false;
}

function getStep(idx) {
function getStep(idx, wiz) {
return Array.from(wiz.children)[idx];
}

Expand Down
5 changes: 5 additions & 0 deletions packages/main/src/themes/Dialog.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@
max-width: 100vw;
}

:host([stretch]) .ui5-popup-content {
width: 100%;
height: 100%;
}

.ui5-popup-content {
min-height: var(--_ui5_dialog_content_min_height);
flex: 1 1 auto;
Expand Down
76 changes: 76 additions & 0 deletions packages/main/test/pages/Dialog.html
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,82 @@
<ui5-textarea id="area" placeholder="Type some text" max-length="2" show-exceeded-text>
</ui5-textarea>

<div style="padding: 1rem;text-align: center;">
<ui5-title level="H2">Hello World!</ui5-title>
</div>

<ui5-select>
<ui5-option>Hello</ui5-option>
<ui5-option>World</ui5-option>
</ui5-select>

<ui5-textarea placeholder="Type some text" max-length="2" show-exceeded-text>
</ui5-textarea>

<div style="padding: 1rem;text-align: center;">
<ui5-title level="H2">Hello World!</ui5-title>
</div>

<ui5-select>
<ui5-option>Hello</ui5-option>
<ui5-option>World</ui5-option>
</ui5-select>

<ui5-textarea placeholder="Type some text" max-length="2" show-exceeded-text>
</ui5-textarea>


<div style="padding: 1rem;text-align: center;">
<ui5-title level="H2">Hello World!</ui5-title>
</div>

<ui5-select>
<ui5-option>Hello</ui5-option>
<ui5-option>World</ui5-option>
</ui5-select>

<ui5-textarea placeholder="Type some text" max-length="2" show-exceeded-text>
</ui5-textarea>


<div style="padding: 1rem;text-align: center;">
<ui5-title level="H2">Hello World!</ui5-title>
</div>

<ui5-select>
<ui5-option>Hello</ui5-option>
<ui5-option>World</ui5-option>
</ui5-select>

<ui5-textarea placeholder="Type some text" max-length="2" show-exceeded-text>
</ui5-textarea>


<div style="padding: 1rem;text-align: center;">
<ui5-title level="H2">Hello World!</ui5-title>
</div>

<ui5-select>
<ui5-option>Hello</ui5-option>
<ui5-option>World</ui5-option>
</ui5-select>

<ui5-textarea placeholder="Type some text" max-length="2" show-exceeded-text>
</ui5-textarea>


<div style="padding: 1rem;text-align: center;">
<ui5-title level="H2">Hello World!</ui5-title>
</div>

<ui5-select>
<ui5-option>Hello</ui5-option>
<ui5-option>World</ui5-option>
</ui5-select>

<ui5-textarea placeholder="Type some text" max-length="2" show-exceeded-text>
</ui5-textarea>

<div slot="footer" style="display: flex; align-items: center;padding: 0.25rem 0.5rem; width: 100%">
<div style="flex: 1;"></div>
<ui5-button id="btnCloseDialog">Close</ui5-button>
Expand Down