Merge pull request #554 from ing-bank/fix/get-label-order
fix(field): changed order get label
This commit is contained in:
commit
2f6f8a21cd
2 changed files with 4 additions and 4 deletions
|
|
@ -54,7 +54,7 @@ export const FormControlMixin = dedupeMixin(
|
|||
}
|
||||
|
||||
get label() {
|
||||
return (this._labelNode && this._labelNode.textContent) || this.__label;
|
||||
return this.__label || (this._labelNode && this._labelNode.textContent);
|
||||
}
|
||||
|
||||
set label(newValue) {
|
||||
|
|
@ -64,7 +64,7 @@ export const FormControlMixin = dedupeMixin(
|
|||
}
|
||||
|
||||
get helpText() {
|
||||
return (this._helpTextNode && this._helpTextNode.textContent) || this.__helpText;
|
||||
return this.__helpText || (this._helpTextNode && this._helpTextNode.textContent);
|
||||
}
|
||||
|
||||
set helpText(newValue) {
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ describe('FormControlMixin', () => {
|
|||
${inputSlot}
|
||||
</${tag}>
|
||||
</${tag}>`);
|
||||
expect(el.label).to.equal(undefined);
|
||||
expect(el.label).to.equal('');
|
||||
});
|
||||
|
||||
it('can have a help-text', async () => {
|
||||
|
|
@ -100,7 +100,7 @@ describe('FormControlMixin', () => {
|
|||
${inputSlot}
|
||||
</${tag}>
|
||||
</${tag}>`);
|
||||
expect(el.helpText).to.equal(undefined);
|
||||
expect(el.helpText).to.equal('');
|
||||
});
|
||||
|
||||
it('does not duplicate aria-describedby and aria-labelledby ids', async () => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue