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;
}
const select = this.#element.querySelector('.cg-select');
if (value === true) {
this.#element.setAttribute('disabled', true);
select.classList.add('disabled');
} else {
this.#element.removeAttribute('disabled');
select.classList.remove('disabled');
}
}

View File

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

View File

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