Closed huiyang closed 2 years ago
System Information
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/tarekraafat-autocomplete.js/10.2.7/css/autoComplete.min.css"> <script src="https://cdnjs.cloudflare.com/ajax/libs/tarekraafat-autocomplete.js/10.2.7/autoComplete.min.js"></script>
Describe the bug autocomplete.js instant not working when it is display: none, it work after display: none is removed.
display: none
To Reproduce Steps to reproduce the behavior:
#search-input { display: none; }
Expected behavior Autocomplete instant should work, when user type on the text field, console should output the query typed.
Configuration used
{ selector: "#search-input", debounce: 500, // Milliseconds value //placeHolder: "Search for Food...", data: { src: async (query) => { console.log('q', query) try { // Fetch Data from external Source const source = await fetch(autoCompleteUrl + '?q=' + query); // Data should be an array of `Objects` or `Strings` const data = await source.json(); return data.records.data; } catch (error) { return error; } }, // Data source 'Object' key to be searched keys: ["name"] } }
Sorry my mistake. It is actually caused by 2 element with same ID.
BTW, hope that the selector can select multiple elements when class selector is applied.
System Information
Describe the bug autocomplete.js instant not working when it is
display: none
, it work afterdisplay: none
is removed.To Reproduce Steps to reproduce the behavior:
Expected behavior Autocomplete instant should work, when user type on the text field, console should output the query typed.
Configuration used