Skip to content

Commit

Permalink
fix: remove undefined from search input
Browse files Browse the repository at this point in the history
  • Loading branch information
SiverianSerpent committed Jan 11, 2023
1 parent afd231f commit 5943a11
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
14 changes: 0 additions & 14 deletions src/modules/header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,6 @@ class Header implements HeaderInterface {
this.handleSearch(e);
}
}
// burgerLogic: EventListener = (e: Event): void => {

// console.log(e)
// const burgerIcon = document.getElementById('nav-icon4') as HTMLDivElement;
// const nav = document.querySelector('.nav');
// if (burgerIcon.classList.contains('open')) {
// burgerIcon.removeAttribute('class');
// nav?.classList.remove('openMenu');
// } else {
// burgerIcon.classList.add('open');
// nav?.classList.add('openMenu');
// }
// }
bind = (): void => {
const search = document.querySelector('.settings__search .settings__btn')
if (search) search.addEventListener('click', this.handleSearch)
Expand Down Expand Up @@ -96,7 +83,6 @@ class Header implements HeaderInterface {
clone.setAttribute('style', 'display: block; order: 1; position: unset;');
newLi.appendChild(clone);
if (!menuList.querySelector('.dope-h1')) {
console.log(1)
menuList.insertAdjacentElement('afterbegin', newLi);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/category.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ class Category implements ModuleInterface {
productViewBtn.addEventListener('change', this.handleProductView)

const searchInput = <HTMLInputElement>document.querySelector('.search-input')
searchInput.value = this.filters.search
searchInput.value = this.filters.search || ''

this.initRangePrice()
this.initRangeRating()
Expand Down

0 comments on commit 5943a11

Please sign in to comment.