|
1 | 1 | import { LightningElement } from 'lwc';
|
2 | 2 |
|
3 | 3 | export default class extends LightningElement {
|
| 4 | + isNull = null; |
4 | 5 | connectedCallback() {
|
5 |
| - this.setAttribute('data-foo', 'foo'); |
6 |
| - this.setAttribute('data-foo', null); |
7 |
| - this.setAttribute('data-bar', null); |
| 6 | + // Non-aria set attribute should be "null" |
| 7 | + this.setAttribute('data-foo-set-attribute', 'foo'); |
| 8 | + this.setAttribute('data-foo-set-attribute', null); |
| 9 | + this.setAttribute('data-bar-set-attribute', null); |
8 | 10 |
|
| 11 | + // Aria null (the attribute should be absent) |
| 12 | + this.ariaDescription = 'awesome description'; |
| 13 | + this.ariaDescription = null; |
| 14 | + |
| 15 | + // Aria null setAttribute (the attribute should be "null") |
9 | 16 | this.setAttribute('aria-label', 'awesome label');
|
10 |
| - this.ariaLabel = null; |
11 |
| - this.setAttribute('aria-description', 'awesome description'); |
12 |
| - this.ariaDescription = undefined; |
| 17 | + this.setAttribute('aria-label', null); |
| 18 | + |
| 19 | + // Aria undefined (the attribute should be "undefined") |
| 20 | + this.setAttribute('aria-describedby', 'awesome label'); |
| 21 | + this.setAttribute('aria-describedby', undefined); |
| 22 | + this.ariaLabelledBy = 'id1'; |
| 23 | + this.ariaLabelledBy = undefined; |
13 | 24 | }
|
14 | 25 | }
|
0 commit comments