Skip to content

Commit 9271a23

Browse files
committed
giving up on moving dropdown to its own module
1 parent 17e06e5 commit 9271a23

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

elements/pfe-autocomplete/src/pfe-autocomplete.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import PFElement from "../../pfelement/dist/pfelement.js";
2-
// import PfeSearchDroplist from "./pfe-search-droplist.js";
32
import "../../pfe-button/dist/pfe-button.js";
43

54
const KEYCODE = {
@@ -149,6 +148,8 @@ class PfeAutocomplete extends PFElement {
149148
this._input.setAttribute("autocorrect", "off");
150149
this._input.setAttribute("autocapitalize", "off");
151150
this._input.setAttribute("spellcheck", "false");
151+
152+
this._input.setAttribute("style", `input[type=search]::-ms-clear { display: none; width : 0; height: 0; }input[type = search]:: -ms - reveal { display: none; width: 0; height: 0; }" nput[type="search"]::-webkit-search-decoration, input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-results-button, input[type="search"]::-webkit-search-results-decoration { display: none; }`)
152153
}
153154

154155
disconnectedCallback() {
@@ -272,11 +273,13 @@ class PfeAutocomplete extends PFElement {
272273
}
273274

274275
_searchCleared() {
275-
this.emitEvent(PfeAutocomplete.events.optionsShown, {
276-
bubbles: true,
277-
composed: true,
278-
detail: { searchValue: searchQuery }
279-
});
276+
if(this._input.value == '') {
277+
this.emitEvent(PfeAutocomplete.events.optionsShown, {
278+
bubbles: true,
279+
composed: true,
280+
detail: { searchValue: searchQuery }
281+
});
282+
}
280283
}
281284

282285
_openDroplist() {

0 commit comments

Comments
 (0)