From dd77e7e016b4b4d7ffe2fd1b6bf9969b6a60ca3a Mon Sep 17 00:00:00 2001 From: nzbin Date: Fri, 17 May 2024 22:41:08 +0800 Subject: [PATCH] refactor(select): use ng-select classes to add mat color --- projects/extensions/select/select.html | 2 +- projects/extensions/select/select.ts | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/projects/extensions/select/select.html b/projects/extensions/select/select.html index 8e9d91c1..382466ef 100644 --- a/projects/extensions/select/select.html +++ b/projects/extensions/select/select.html @@ -1,4 +1,4 @@ - { - const dropdownEl = document.getElementById(this.ngSelect.dropdownId) as HTMLElement; - dropdownEl.classList.add('mat-' + this._parentFormField?.color); - }); + // The ng-select has no `panelClass` prop, so we can add the theme color by the following way. + this.ngSelect.classes += ' mat-' + this._parentFormField?.color; } }