Merge pull request #1419 from Safelite/CSR-1708-fix-error-copy-alignment

CSR-1708 center error text when <= 2 buttons.
This commit is contained in:
bmauger 2023-10-17 14:05:01 -04:00 committed by GitHub
commit 824cc0977c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 1 deletions

View file

@ -72,7 +72,10 @@ https://safelite.atlassian.net/wiki/spaces/DC/pages/76644418/Button+Question+Com
</div> </div>
</fieldset> </fieldset>
</div> </div>
<div class="row form-test-error"> <div
id="form-test-error"
class="row form-test-error"
:class="isErrorCentered ? 'text-center' : ''">
<error-message <error-message
role="comment" role="comment"
aria-atomic="true" aria-atomic="true"
@ -227,8 +230,18 @@ export default {
classes += " two-list-card-width"; classes += " two-list-card-width";
} }
if (this.buttonTypeString == "listCard" && this.buttonsInfo.length === 1) {
classes += " one-list-card-width";
}
return classes; return classes;
}, },
isErrorCentered() {
if (this.buttonTypeString == "listCard" && this.buttonsInfo.length <= 2) {
return true;
}
return false;
},
buttonsInfo() { buttonsInfo() {
return (Array.isArray(this.answers) ? this.answers : [])?.map((answer) => ({ return (Array.isArray(this.answers) ? this.answers : [])?.map((answer) => ({
buttonLabel: answer.buttonLabel ?? answer.Text ?? answer, buttonLabel: answer.buttonLabel ?? answer.Text ?? answer,

View file

@ -23,6 +23,12 @@ body {
} }
.col { .col {
max-width: 236px; max-width: 236px;
&.one-list-card-width {
max-width: 472px;
@include media-breakpoint-up(xl) {
max-width: 66.6666666%;
}
}
} }
} }
.col-xl-4 { .col-xl-4 {