Skip to content

Commit

Permalink
fix: don't reuse CSS class of the parent container
Browse files Browse the repository at this point in the history
  • Loading branch information
steve-lebleu committed Apr 4, 2024
1 parent a5ed6b4 commit 860ce16
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dist/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/main.js.map

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,17 @@
value="" />
</div>

<div class="form--search">
<input
type="text"
name="auto-complete-2"
id="auto-complete-2"
class="input--search"
autocomplete="off"
placeholder="Enter a city name ..."
value="" />
</div>

<footer>
<p>
© 2017 Konfer
Expand Down
2 changes: 1 addition & 1 deletion src/js/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export class DOM {
this.result = this.build('div', [ { id: this._identifiers.results }, { class: this._classes.results } ]);

this.wrapper = this.build('div', [ { id: this._identifiers.wrapper }, { class: this._classes.results } ]);
this.wrapper.setAttribute('class', `${this._input.parentElement.getAttribute('class')} ${this._classes.main} ${options.theme}`);
this.wrapper.setAttribute('class', `${this._classes.main} ${options.theme}`);

this.input.parentNode.insertBefore(this.wrapper, this.input);

Expand Down
2 changes: 0 additions & 2 deletions src/sass/kompletr.demo.scss
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ footer {
margin: 0 auto;
padding: 15px 10px;
width: 100%;
min-width: 240px;
max-width: 600px;
height: auto;
font-size: 1rem;
line-height: 1.5;
Expand Down

0 comments on commit 860ce16

Please sign in to comment.