@lion/field
Advanced tools
Comparing version 0.8.6 to 0.8.7
@@ -6,2 +6,13 @@ # Change Log | ||
## [0.8.7](https://github.com/ing-bank/lion/compare/@lion/field@0.8.6...@lion/field@0.8.7) (2020-02-05) | ||
### Bug Fixes | ||
* **field:** limit get label/help-text to childNodes ([7f4320d](https://github.com/ing-bank/lion/commit/7f4320dbdfda188f7f6232fe3f72138da225a956)) | ||
## [0.8.6](https://github.com/ing-bank/lion/compare/@lion/field@0.8.5...@lion/field@0.8.6) (2020-02-05) | ||
@@ -8,0 +19,0 @@ |
{ | ||
"name": "@lion/field", | ||
"version": "0.8.6", | ||
"version": "0.8.7", | ||
"description": "Fields are the most fundamental building block of the Form System", | ||
@@ -45,3 +45,3 @@ "author": "ing-bank", | ||
}, | ||
"gitHead": "19a0909df3b9ad290343b434e1ee1d570a7259ce" | ||
"gitHead": "e7406054fc052866cb13d2b9ece6994aeac82e4b" | ||
} |
@@ -57,7 +57,3 @@ import { html, css, nothing, dedupeMixin, SlotMixin } from '@lion/core'; | ||
get label() { | ||
return ( | ||
(this.querySelector('[slot="label"]') && | ||
this.querySelector('[slot="label"]').textContent) || | ||
this.__label | ||
); | ||
return (this._labelNode && this._labelNode.textContent) || this.__label; | ||
} | ||
@@ -72,7 +68,3 @@ | ||
get helpText() { | ||
return ( | ||
(this.querySelector('[slot="help-text"]') && | ||
this.querySelector('[slot="help-text"]').textContent) || | ||
this.__helpText | ||
); | ||
return (this._helpTextNode && this._helpTextNode.textContent) || this.__helpText; | ||
} | ||
@@ -79,0 +71,0 @@ |
@@ -56,2 +56,12 @@ import { expect, fixture, html, defineCE, unsafeStatic } from '@open-wc/testing'; | ||
it('only takes label of direct child', async () => { | ||
const el = await fixture(html` | ||
<${tag}> | ||
<${tag} label="Email address"> | ||
${inputSlot} | ||
</${tag}> | ||
</${tag}>`); | ||
expect(el.label).to.equal(undefined); | ||
}); | ||
it('can have a help-text', async () => { | ||
@@ -72,3 +82,3 @@ const elAttr = await fixture(html` | ||
<${tag}> | ||
<label slot="help-text">We will not send you any spam</label> | ||
<div slot="help-text">We will not send you any spam</div> | ||
${inputSlot} | ||
@@ -82,3 +92,3 @@ </${tag}>`); | ||
<${tag}> | ||
<label slot="help-text">We will not send you any spam</label> | ||
<div slot="help-text">We will not send you any <span>spam</span></div> | ||
${inputSlot} | ||
@@ -89,2 +99,12 @@ </${tag}>`); | ||
it('only takes help-text of direct child', async () => { | ||
const el = await fixture(html` | ||
<${tag}> | ||
<${tag} help-text="We will not send you any spam"> | ||
${inputSlot} | ||
</${tag}> | ||
</${tag}>`); | ||
expect(el.helpText).to.equal(undefined); | ||
}); | ||
it('does not duplicate aria-describedby and aria-labelledby ids', async () => { | ||
@@ -91,0 +111,0 @@ const lionField = await fixture(` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
158551
3176