Merge pull request #987 from Safelite/feature/richardson/INSR-7917

Updates for sub caption on textbox
This commit is contained in:
brich1212safe 2025-12-18 14:10:09 -05:00 committed by GitHub
commit 19c34ac240
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 22 additions and 4 deletions

View file

@ -686,7 +686,7 @@ describe('TextboxQuestion', () => {
});
// Assert
expect(wrapper.vm.questionText).toBe(cmsContent);
expect(wrapper.vm.questionTextForAria).toBe(cmsContent);
});
describe('"value" should', () => {
test('get the modelValue prop', () => {

View file

@ -5,7 +5,7 @@
<label
v-if="displayQuestionText"
:for="inputId"
:aria-label="questionText"
:aria-label="questionTextForAria"
class="form-label"
:class="[questionAlignment === 'center' ? 'text-center w-100 mb-5' : '']"
v-html="questionText"></label>
@ -29,7 +29,7 @@
:aria-disabled="isDisabled"
:disabled="isDisabled"
:aria-required="isRequired"
:aria-label="questionText"
:aria-label="questionTextForAria"
:min="min"
:max="max"
:required="isRequired"
@ -72,6 +72,7 @@
<script>
import { useField, validate } from 'vee-validate';
import { extractSpanText } from '@/helpers/text-helper';
export default {
name: 'textbox-question',
@ -154,6 +155,9 @@ export default {
questionText() {
return this.getCmsContent(this.cmsWidgetName, 'QuestionText');
},
questionTextForAria() {
return extractSpanText(this.getCmsContent(this.cmsWidgetName, 'QuestionText'));
},
value: {
get() {
return this.modelValue;

View file

@ -10,6 +10,12 @@ export function stripRteStyle(stringWithStyleTag) {
return stringWithStyleTag.replace(regexExp, '');
}
export function extractSpanText(spanElement) {
const tempContainer = document.createElement('div');
tempContainer.innerHTML = spanElement;
return tempContainer.textContent || tempContainer.innerText || '';
}
/**
* @function createOrderedListFromStringOfParagraphs
* @summary

View file

@ -151,7 +151,7 @@
cmsWidgetName="HelpTextWidget"
linkType="navigation"
href="javascript:void(0)"
class="mt-3 text-left"
class="mb-5 text-left"
@clickEvent="handleHelpLinkClick" />
</div>
</div>

View file

@ -170,6 +170,14 @@ body {
width: 58.33333333%;
}
}
div.textbox-question {
label {
span.sub-caption {
font-weight: 400;
}
}
}
}
:root {