Fix styles in fn disabled

This commit is contained in:
Макс Овсяников 2022-10-13 12:37:27 +03:00
parent 3a031a864e
commit 556f05916d
3 changed files with 10 additions and 6 deletions

View File

@ -84,10 +84,13 @@ export class DropDown {
return; return;
} }
const select = this.#element.querySelector('.cg-select');
if (value === true) { if (value === true) {
this.#element.setAttribute('disabled', true); this.#element.setAttribute('disabled', true);
select.classList.add('disabled');
} else { } else {
this.#element.removeAttribute('disabled'); this.#element.removeAttribute('disabled');
select.classList.remove('disabled');
} }
} }

View File

@ -4,11 +4,7 @@ const dropdown = new DropDown({
selector: '.cg-dropdown_one', selector: '.cg-dropdown_one',
placeholder: 'Выберите авто', placeholder: 'Выберите авто',
items: ['BMW', 'Opel', 'Mersedes', 'MAN', 'max'], items: ['BMW', 'Opel', 'Mersedes', 'MAN', 'max'],
styles: {
head: {
background: '#4d629f',
},
},
multiselect: true, multiselect: true,
multiselectTag: true, multiselectTag: true,
}); });
@ -54,9 +50,10 @@ const dropdown2 = new DropDown({
// multiselectTag: true, // multiselectTag: true,
}); });
dropdown2.addItem('LADA');
dropdown.disabled(false); dropdown.disabled(false);
dropdown2.addItem('LADA');
//ToDo: paste the desired url; //ToDo: paste the desired url;
const dropdown3 = new DropDown({ const dropdown3 = new DropDown({

View File

@ -191,3 +191,7 @@ input[type='checkbox'] {
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
background-color: #4d4d4d; background-color: #4d4d4d;
} }
.disabled {
background-color: #8f9195 !important;
}