diff --git a/components/tag-list/tag-list-item-mixin.js b/components/tag-list/tag-list-item-mixin.js index 1ca226ad62..81d000ea49 100644 --- a/components/tag-list/tag-list-item-mixin.js +++ b/components/tag-list/tag-list-item-mixin.js @@ -135,7 +135,7 @@ export const TagListItemMixin = superclass => class extends LocalizeCoreElement( this.keyboardTooltipItem = false; this.keyboardTooltipShown = false; this._id = getUniqueId(); - this._labelText = ''; + this._plainText = ''; } firstUpdated(changedProperties) { @@ -172,7 +172,7 @@ export const TagListItemMixin = superclass => class extends LocalizeCoreElement( _handleClearItem() { if (!this.clearable) return; - announce(this.localize('components.tag-list.cleared-item', { value: this._labelText })); + announce(this.localize('components.tag-list.cleared-item', { value: this._plainText })); /** Dispatched when a user selects to delete an individual tag list item. The consumer must handle the actual element deletion and focus behaviour if there are no remaining list items. */ this.dispatchEvent(new CustomEvent( @@ -216,10 +216,10 @@ export const TagListItemMixin = superclass => class extends LocalizeCoreElement( } _renderTag(tagContent, options = {}) { - if (options.labelText?.constructor !== String) throw new TypeError('options.labelText must be a string'); - this._labelText = options.labelText || ''; + if (options.plainText?.constructor !== String) throw new TypeError('options.plainText must be a string'); + this._plainText = options.plainText || ''; - const buttonText = this.localize('components.tag-list.clear', { value: this._labelText }); + const buttonText = this.localize('components.tag-list.clear', { value: this._plainText }); const hasDescription = !!options.description; diff --git a/components/tag-list/tag-list-item.js b/components/tag-list/tag-list-item.js index 934206208b..d6cb2e5023 100644 --- a/components/tag-list/tag-list-item.js +++ b/components/tag-list/tag-list-item.js @@ -23,7 +23,7 @@ class TagListItem extends TagListItemMixin(LitElement) { return this._renderTag(this.text, { description: this.description, hasTruncationTooltip: true, - labelText: this.text + plainText: this.text }); } } diff --git a/components/tag-list/test/tag-list-item-mixin-consumer.js b/components/tag-list/test/tag-list-item-mixin-consumer.js index 734be88298..4d12093055 100644 --- a/components/tag-list/test/tag-list-item-mixin-consumer.js +++ b/components/tag-list/test/tag-list-item-mixin-consumer.js @@ -57,7 +57,7 @@ class TagListItemMixinConsumer extends TagListItemMixin(LitElement) { return html` - ${this._renderTag(tagContent, { focusableClass: 'd2l-dropdown-opener', labelText: this.name })} + ${this._renderTag(tagContent, { focusableClass: 'd2l-dropdown-opener', plainText: this.name })} Custom `; diff --git a/components/tag-list/test/tag-list.test.js b/components/tag-list/test/tag-list.test.js index 6de518842b..b6bb95134d 100644 --- a/components/tag-list/test/tag-list.test.js +++ b/components/tag-list/test/tag-list.test.js @@ -97,7 +97,7 @@ describe('d2l-tag-list-item', () => { await waitUntil(() => elem._items, 'List items did not become ready'); const child = elem.children[1]; - expect(child._labelText).to.be.equal('Another Tag'); + expect(child._plainText).to.be.equal('Another Tag'); }); }); @@ -164,7 +164,7 @@ describe('d2l-tag-list-item-mixin-consumer', () => { await waitUntil(() => elem._items, 'List items did not become ready'); const child = elem.children[3]; - expect(child._labelText).to.be.equal('Tag'); + expect(child._plainText).to.be.equal('Tag'); }); it('should error if not provided', async() => {