Skip to content

Commit

Permalink
Fixed #7961 - Scrollbar appears for the matrix with required question…
Browse files Browse the repository at this point in the history
… (at least in Safari) (#8000)

* Fixed #7961 - Scrollbar appears for the matrix with required question (at least in Safari)

* Work for #7961 - Scrollbar appears for the matrix with required question (at least in Safari)

* Try to fix react navigation vr-tests

* Try to fix vr-tests

---------

Co-authored-by: tsv2013 <tsv2013@noreply.github.com>
  • Loading branch information
tsv2013 and tsv2013 committed Mar 22, 2024
1 parent 6e52a6e commit 9cbcb29
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
2 changes: 0 additions & 2 deletions src/defaultV2-theme/blocks/sd-element.scss
Expand Up @@ -131,8 +131,6 @@
padding-bottom: var(--sd-base-padding);
background: $question-background;
box-shadow: $shadow-small;
display: flex;
flex-direction: column;
}

//compact styles
Expand Down
8 changes: 7 additions & 1 deletion src/defaultV2-theme/blocks/sd-question.scss
Expand Up @@ -13,6 +13,7 @@
.sd-question__content--support-container-queries {
container-type: inline-size;
}

.sd-question--title-top>.sd-question__erbox--above-question {
margin-bottom: calc(0.5 * var(--sd-base-vertical-padding));
}
Expand All @@ -26,9 +27,11 @@
margin-bottom: var(--sd-base-padding);
border-radius: calcCornerRadius(1) calcCornerRadius(1) 0 0;
}

.sd-question--left>.sd-element__erbox--above-element {
margin-bottom: 0;
}

.sd-element--with-frame.sd-question--left>.sd-element__erbox--above-element {
margin-bottom: calc(1 * var(--sd-base-vertical-padding));
}
Expand Down Expand Up @@ -70,6 +73,8 @@

&.sd-question--error-bottom {
padding-bottom: 0;
display: flex;
flex-direction: column;

&>.sd-question__content {
margin-bottom: var(--sd-base-padding)
Expand Down Expand Up @@ -108,7 +113,8 @@
flex: 1;
margin-top: calc(0.25 * var(--sd-base-vertical-padding)) 0;
}
.sd-element--with-frame > .sd-question__content--left {

.sd-element--with-frame>.sd-question__content--left {
margin: 0;
}

Expand Down
2 changes: 1 addition & 1 deletion src/progress-buttons.ts
Expand Up @@ -82,7 +82,7 @@ export class ProgressButtons extends Base {
const listContainerElement = element.querySelector("ul");
if (!listContainerElement) return;
const listContainerElements = element.querySelectorAll(".sd-progress-buttons__connector");
const circleWidth = this.showItemNumbers ? 17 : 7;
const circleWidth = this.showItemNumbers ? 17 : 5;
const connectorWidth = listContainerElement.clientWidth / (listContainerElement.children.length - 1) - circleWidth;
for (let i = 0; i < listContainerElements.length; i++) {
(listContainerElements[i] as HTMLDivElement).style.width = connectorWidth + "px";
Expand Down
9 changes: 4 additions & 5 deletions src/survey.ts
Expand Up @@ -4795,13 +4795,12 @@ export class SurveyModel extends SurveyElementCore
}
private processResponsiveness(width: number, mobileWidth: number): boolean {
const isMobile = width < mobileWidth;
this.layoutElements.forEach(layoutElement => layoutElement.processResponsiveness && layoutElement.processResponsiveness(width));
if (this.isMobile === isMobile) {
return false;
} else {
const isMobileChanged = this.isMobile !== isMobile;
if (isMobileChanged) {
this.setIsMobile(isMobile);
return true;
}
this.layoutElements.forEach(layoutElement => layoutElement.processResponsiveness && layoutElement.processResponsiveness(width));
return isMobileChanged;
}

public triggerResponsiveness(hard: boolean) {
Expand Down

0 comments on commit 9cbcb29

Please sign in to comment.