-
Notifications
You must be signed in to change notification settings - Fork 401
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: align aria null behavior between setting methods * fix: setAttribute string case * fix: revert missing stringify * fix: revert deletion * fix: revert setAttribute 'null' behavior change
- Loading branch information
1 parent
891f3fb
commit b2468c9
Showing
5 changed files
with
28 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/@lwc/engine-server/src/__tests__/fixtures/attribute-null/expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<x-test aria-description="undefined" data-bar="null" data-foo="null" data-lwc-host-mutated="aria-description aria-label data-bar data-foo"> | ||
<x-test aria-describedby="undefined" aria-label="null" aria-labelledby="undefined" data-bar-set-attribute="null" data-foo-set-attribute="null" data-lwc-host-mutated="aria-describedby aria-description aria-label aria-labelledby data-bar-set-attribute data-foo-set-attribute"> | ||
<template shadowrootmode="open"> | ||
</template> | ||
</x-test> |
23 changes: 17 additions & 6 deletions
23
packages/@lwc/engine-server/src/__tests__/fixtures/attribute-null/modules/x/test/test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,25 @@ | ||
import { LightningElement } from 'lwc'; | ||
|
||
export default class extends LightningElement { | ||
isNull = null; | ||
connectedCallback() { | ||
this.setAttribute('data-foo', 'foo'); | ||
this.setAttribute('data-foo', null); | ||
this.setAttribute('data-bar', null); | ||
// Non-aria set attribute should be "null" | ||
this.setAttribute('data-foo-set-attribute', 'foo'); | ||
this.setAttribute('data-foo-set-attribute', null); | ||
this.setAttribute('data-bar-set-attribute', null); | ||
|
||
// Aria null (the attribute should be absent) | ||
this.ariaDescription = 'awesome description'; | ||
this.ariaDescription = null; | ||
|
||
// Aria null setAttribute (the attribute should be "null") | ||
this.setAttribute('aria-label', 'awesome label'); | ||
this.ariaLabel = null; | ||
this.setAttribute('aria-description', 'awesome description'); | ||
this.ariaDescription = undefined; | ||
this.setAttribute('aria-label', null); | ||
|
||
// Aria undefined (the attribute should be "undefined") | ||
this.setAttribute('aria-describedby', 'awesome label'); | ||
this.setAttribute('aria-describedby', undefined); | ||
this.ariaLabelledBy = 'id1'; | ||
this.ariaLabelledBy = undefined; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters