From 0035cb2f752a1361e324acb13fab3888c3c86c88 Mon Sep 17 00:00:00 2001 From: MaxOvs Date: Wed, 21 Sep 2022 12:01:12 +0300 Subject: [PATCH] Fixed bug in create two ul --- src/cg-dropdown.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/cg-dropdown.js b/src/cg-dropdown.js index 75c9488..3f39139 100644 --- a/src/cg-dropdown.js +++ b/src/cg-dropdown.js @@ -77,12 +77,14 @@ export class DropDown { return; } - const templete = items.map((item) => `
  • ${item}
  • `).join(''); - this.#element.innerHTML += ``; + if (!styles) { + const templete = items.map((item) => `
  • ${item}
  • `).join(''); + this.#element.innerHTML += ``; + } if (styles) { const templete = items.map((item) => `
  • ${item}
  • `).join(''); - this.#element.innerHTML += ``; + this.#element.innerHTML += ``; this.#customStyles(styles); }