Fixed bug in create two ul

This commit is contained in:
Макс Овсяников 2022-09-21 12:01:12 +03:00
parent 415afb9d5e
commit 0035cb2f75

View File

@ -77,12 +77,14 @@ export class DropDown {
return;
}
const templete = items.map((item) => `<li class="list__item" >${item}</li>`).join('');
this.#element.innerHTML += `<ul class="list">${templete}</ul>`;
if (!styles) {
const templete = items.map((item) => `<li class="list__item" >${item}</li>`).join('');
this.#element.innerHTML += `<ul class="list">${templete}</ul>`;
}
if (styles) {
const templete = items.map((item) => `<li class="list__item" >${item}</li>`).join('');
this.#element.innerHTML += `<ul class="list style = "${styles}">${templete}</ul>`;
this.#element.innerHTML += `<ul class="list" style="${styles}" >${templete}</ul>`;
this.#customStyles(styles);
}