Merge pull request #554 from ing-bank/fix/get-label-order

fix(field): changed order get label
This commit is contained in:
Thijs Louisse 2020-02-06 14:56:21 +01:00 committed by GitHub
commit 2f6f8a21cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -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) {

View file

@ -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 () => {