diff --git a/packages/carbon-web-components/src/components/date-picker/date-picker-input.ts b/packages/carbon-web-components/src/components/date-picker/date-picker-input.ts index 43df7e296fc..e1fc32fa24c 100644 --- a/packages/carbon-web-components/src/components/date-picker/date-picker-input.ts +++ b/packages/carbon-web-components/src/components/date-picker/date-picker-input.ts @@ -336,8 +336,8 @@ class CDSDatePickerInput extends FocusMixin(LitElement) { this.shadowRoot ?.querySelector("slot[name='slug']") ?.classList.toggle( - 'cds--slug--revert', - this.querySelector('cds-slug')?.hasAttribute('revert-active') + `${prefix}--slug--revert`, + this.querySelector(`${prefix}-slug`)?.hasAttribute('revert-active') ); } diff --git a/packages/carbon-web-components/src/components/dropdown/dropdown.ts b/packages/carbon-web-components/src/components/dropdown/dropdown.ts index 0d399e8a3e8..858f46ef46c 100644 --- a/packages/carbon-web-components/src/components/dropdown/dropdown.ts +++ b/packages/carbon-web-components/src/components/dropdown/dropdown.ts @@ -680,8 +680,8 @@ class CDSDropdown extends ValidityMixin( this.shadowRoot ?.querySelector("slot[name='slug']") ?.classList.toggle( - 'cds--slug--revert', - this.querySelector('cds-slug')?.hasAttribute('revert-active') + `${prefix}--slug--revert`, + this.querySelector(`${prefix}-slug`)?.hasAttribute('revert-active') ); } diff --git a/packages/carbon-web-components/src/components/select/select.ts b/packages/carbon-web-components/src/components/select/select.ts index fcf5cbe2745..8bce4b51bb4 100644 --- a/packages/carbon-web-components/src/components/select/select.ts +++ b/packages/carbon-web-components/src/components/select/select.ts @@ -346,8 +346,8 @@ class CDSSelect extends FormMixin(LitElement) { this.shadowRoot ?.querySelector("slot[name='slug']") ?.classList.toggle( - 'cds--slug--revert', - this.querySelector('cds-slug')?.hasAttribute('revert-active') + `${prefix}--slug--revert`, + this.querySelector(`${prefix}-slug`)?.hasAttribute('revert-active') ); } diff --git a/packages/carbon-web-components/src/components/text-input/text-input.ts b/packages/carbon-web-components/src/components/text-input/text-input.ts index 2e38b400708..247e0213699 100644 --- a/packages/carbon-web-components/src/components/text-input/text-input.ts +++ b/packages/carbon-web-components/src/components/text-input/text-input.ts @@ -506,8 +506,8 @@ class CDSTextInput extends ValidityMixin(FormMixin(LitElement)) { this.shadowRoot ?.querySelector("slot[name='slug']") ?.classList.toggle( - 'cds--slug--revert', - this.querySelector('cds-slug')?.hasAttribute('revert-active') + `${prefix}--slug--revert`, + this.querySelector(`${prefix}-slug`)?.hasAttribute('revert-active') ); }