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

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

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 2 additions & 0 deletions packages/survey-angular-ui/src/errors.component.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<div *ngFor="let error of element.errors;">
<div>
<span
[class]="element.cssClasses ? element.cssClasses.error.icon : 'panel-error-icon'"
aria-hidden="true"
></span>
<span [class]="element.cssClasses ? element.cssClasses.error.item : 'panel-error-item'" [model]="error.locText" sv-ng-string>
</span>
</div>
</div>
2 changes: 2 additions & 0 deletions packages/survey-vue3-ui/src/Errors.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
ref="root"
>
<div v-for="(error, index) in element.errors" :key="'error_' + index">
<div>
<span
:class="
element.cssClasses
Expand All @@ -26,6 +27,7 @@
<survey-string :locString="error.locText" />
</span>
</div>
</div>
</div>
</template>

Expand Down
32 changes: 20 additions & 12 deletions src/defaultV2-theme/blocks/sd-error.scss
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
.sd-error {
display: block;
padding: calcSize(1) calcSize(1.5);
border-radius: calcCornerRadius(1);
line-height: calcLineHeight(1);
font-size: calcFontSize(0.75);
font-weight: 600;
text-align: left;
color: $red;
white-space: normal;
width: 100%;
background-color: $red-light;
box-sizing: border-box;
overflow: visible;

&>div {
margin: 0 calcSize(-5);

&>div {
display: block;
padding: calcSize(1) calcSize(1.5);
border-radius: calcCornerRadius(1);
line-height: calcLineHeight(1);
font-size: calcFontSize(0.75);
font-weight: 600;
text-align: left;
color: $red;
white-space: normal;
width: 100%;
background-color: $red-light;
box-sizing: border-box;
}
}
}
12 changes: 7 additions & 5 deletions src/knockout/templates/question-errors.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<script type="text/html" id="survey-question-errors">
<!-- ko if: hasVisibleErrors -->
<div role="alert" aria-live="polite" data-bind="visible: hasVisibleErrors, foreach: { data: errors, as: 'error' }, css: cssError, attr: { id: question.id + '_errors' }">
<!-- ko if: error.visible -->
<div>
<!-- ko if: hasVisibleErrors -->
<div role="alert" aria-live="polite" data-bind="visible: hasVisibleErrors, foreach: { data: errors, as: 'error' }, css: cssError, attr: { id: question.id + '_errors' }">
<!-- ko if: error.visible -->
<div>
<div>
<span aria-hidden="true" data-bind="css: question.cssClasses.error.icon"></span>
<span data-bind="css: question.cssClasses.error.item">
<!-- ko template: { name: 'survey-string', data: error.locText } --><!-- /ko -->
</span>
</div>
<!-- /ko -->
</div>
<!-- /ko -->
</div>
<!-- /ko -->
</script>
18 changes: 10 additions & 8 deletions src/react/reactSurvey.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class Survey extends SurveyElementBase<any, any>
componentDidUpdate(prevProps: any, prevState: any) {
super.componentDidUpdate(prevProps, prevState);
this.updateSurvey(this.props, prevProps);
if(this.isSurveyUpdated) {
if (this.isSurveyUpdated) {
this.onSurveyUpdated();
this.isSurveyUpdated = false;
}
Expand Down Expand Up @@ -108,7 +108,7 @@ export class Survey extends SurveyElementBase<any, any>

return (
<div id={this.rootNodeId} ref={this.rootRef} className={cssClasses} style={this.survey.themeVariables}>
{this.survey.needRenderIcons ? <SvgBundleComponent></SvgBundleComponent> : null }
{this.survey.needRenderIcons ? <SvgBundleComponent></SvgBundleComponent> : null}
<div className={this.survey.wrapperFormCss}>
{backgroundImage}
<form onSubmit={onSubmit}>
Expand All @@ -120,7 +120,7 @@ export class Survey extends SurveyElementBase<any, any>
<ComponentsContainer survey={this.survey} container={"footer"} needRenderWrapper={false}></ComponentsContainer>
</div>
</form>
{ this.survey.showBrandInfo ? <BrandInfo/> : null }
{this.survey.showBrandInfo ? <BrandInfo /> : null}
<NotifierComponent notifier={this.survey.notifier} ></NotifierComponent>
</div>
</div>
Expand Down Expand Up @@ -170,7 +170,7 @@ export class Survey extends SurveyElementBase<any, any>

let className = this.survey.bodyCss;
const style: any = {};
if(!!this.survey.renderedWidth) {
if (!!this.survey.renderedWidth) {
style.maxWidth = this.survey.renderedWidth;
}
return (
Expand Down Expand Up @@ -290,10 +290,12 @@ export class Survey extends SurveyElementBase<any, any>
): JSX.Element {
return (
<div key={key}>
<span className={cssClasses.error.icon || undefined} aria-hidden="true" />
<span className={cssClasses.error.item || undefined}>
<SurveyLocStringViewer locStr={error.locText} />
</span>
<div>
<span className={cssClasses.error.icon || undefined} aria-hidden="true" />
<span className={cssClasses.error.item || undefined}>
<SurveyLocStringViewer locStr={error.locText} />
</span>
</div>
</div>
);
}
Expand Down
2 changes: 2 additions & 0 deletions src/vue/errors.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
:id="element.id + '_errors'"
>
<div v-for="(error, index) in element.errors" :key="'error_' + index">
<div>
<span
:class="element.cssClasses ? element.cssClasses.error.icon || undefined : 'panel-error-icon'"
aria-hidden="true"
Expand All @@ -17,6 +18,7 @@
<survey-string :locString="error.locText" />
</span>
</div>
</div>
</div>
</template>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@
<td class="sd-table__cell sd-table__cell--error sd-table__cell--error-bottom" colspan="1" data-responsive-title="" title="">
<div aria-live="polite" class="sd-element__erbox sd-error sd-question__erbox sd-question__erbox--below-question" id="testid0row0cell1_errors" role="alert">
<div>
<span aria-hidden="true">
</span>
<span>
<span class="sv-string-viewer">Response required.</span>
</span>
<div>
<span aria-hidden="true">
</span>
<span>
<span class="sv-string-viewer">Response required.</span>
</span>
</div>
</div>
</div>
</td>
Expand Down
12 changes: 7 additions & 5 deletions tests/markup/snapshots/matrixdropdown-cell-errors-top.snap.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@
<td class="sd-table__cell sd-table__cell--error sd-table__cell--error-top" colspan="1" data-responsive-title="" title="">
<div aria-live="polite" class="sd-element__erbox sd-element__erbox--above-element sd-error sd-question__erbox sd-question__erbox--above-question" id="testid0row1cell1_errors" role="alert">
<div>
<span aria-hidden="true">
</span>
<span>
<span class="sv-string-viewer">Response required.</span>
</span>
<div>
<span aria-hidden="true">
</span>
<span>
<span class="sv-string-viewer">Response required.</span>
</span>
</div>
</div>
</div>
</td>
Expand Down
12 changes: 7 additions & 5 deletions tests/markup/snapshots/multipletext-error-bottom-v2.snap.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@
<td class="sd-multipletext__cell sd-multipletext__cell--error sd-multipletext__cell--error-bottom">
<div aria-live="polite" class="sd-element__erbox sd-error sd-question__erbox sd-question__erbox--below-question" id="testid0_0_errors" role="alert">
<div>
<span aria-hidden="true">
</span>
<span>
<span class="sv-string-viewer">Response required.</span>
</span>
<div>
<span aria-hidden="true">
</span>
<span>
<span class="sv-string-viewer">Response required.</span>
</span>
</div>
</div>
</div>
</td>
Expand Down
12 changes: 7 additions & 5 deletions tests/markup/snapshots/multipletext-error-top-v2.snap.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
<td class="sd-multipletext__cell sd-multipletext__cell--error sd-multipletext__cell--error-top">
<div aria-live="polite" class="sd-element__erbox sd-element__erbox--above-element sd-error sd-question__erbox sd-question__erbox--above-question" id="testid0_0_errors" role="alert">
<div>
<span aria-hidden="true">
</span>
<span>
<span class="sv-string-viewer">Response required.</span>
</span>
<div>
<span aria-hidden="true">
</span>
<span>
<span class="sv-string-viewer">Response required.</span>
</span>
</div>
</div>
</div>
</td>
Expand Down
12 changes: 7 additions & 5 deletions tests/markup/snapshots/question-errors-v2-bottom.snap.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ <h5 class="sd-element__title sd-question__title sd-question__title--error sd-que
</div>
<div aria-live="polite" class="sd-element__erbox sd-error sd-question__erbox sd-question__erbox--below-question" id="testid0_errors" role="alert">
<div>
<span aria-hidden="true">
</span>
<span>
<span class="sv-string-viewer">Response required.</span>
</span>
<div>
<span aria-hidden="true">
</span>
<span>
<span class="sv-string-viewer">Response required.</span>
</span>
</div>
</div>
</div>
</div>
Expand Down
12 changes: 7 additions & 5 deletions tests/markup/snapshots/question-errors-v2-top.snap.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
<div class="sd-element sd-element--with-frame sd-question sd-question--error sd-question--error-top sd-question--title-top sd-row__question sd-row__question--small" data-name="name" id="testid0">
<div aria-live="polite" class="sd-element__erbox sd-element__erbox--above-element sd-error sd-question__erbox sd-question__erbox--above-question" id="testid0_errors" role="alert">
<div>
<span aria-hidden="true">
</span>
<span>
<span class="sv-string-viewer">Response required.</span>
</span>
<div>
<span aria-hidden="true">
</span>
<span>
<span class="sv-string-viewer">Response required.</span>
</span>
</div>
</div>
</div>
<div class="sd-element__header sd-element__header--location-top sd-question__header sd-question__header--location-top">
Expand Down
Loading