Updates for sub caption on textbox
Some welcome css for need help blurb
This commit is contained in:
parent
22fb6bb993
commit
ba9ee763e0
5 changed files with 22 additions and 4 deletions
|
|
@ -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', () => {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -170,6 +170,14 @@ body {
|
|||
width: 58.33333333%;
|
||||
}
|
||||
}
|
||||
|
||||
div.textbox-question {
|
||||
label {
|
||||
span.sub-caption {
|
||||
font-weight: 400;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
:root {
|
||||
|
|
|
|||
Loading…
Reference in a new issue