Skip to content

Commit

Permalink
Merge pull request #194 from Autre31415/ol6-fix
Browse files Browse the repository at this point in the history
Fix broken search button in openlayers 6
  • Loading branch information
jonataswalker authored Oct 9, 2019
2 parents c9a0445 + 062d07c commit c59f984
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/nominatim.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ export class Nominatim {

setListeners() {
let timeout, lastQuery;
const openSearch = () => {
const openSearch = evt => {
evt.stopPropagation();

hasClass(this.els.control, klasses.glass.expanded)
? this.collapse()
: this.expand();
Expand All @@ -77,6 +79,9 @@ export class Nominatim {
this.query(value);
}
};
const stopBubbling = evt => {
evt.stopPropagation();
};
const reset = evt => {
this.els.input.focus();
this.els.input.value = '';
Expand All @@ -102,6 +107,7 @@ export class Nominatim {
}
};
this.els.input.addEventListener('keypress', query, false);
this.els.input.addEventListener('click', stopBubbling, false);
this.els.input.addEventListener('input', handleValue, false);
this.els.reset.addEventListener('click', reset, false);
if (this.options.targetType === TARGET_TYPE.GLASS) {
Expand Down

0 comments on commit c59f984

Please sign in to comment.