Skip to content

Commit

Permalink
Disable autocomplete
Browse files Browse the repository at this point in the history
Hopefully that fixes the datalist
  • Loading branch information
NightScript370 committed Dec 25, 2024
1 parent 4cb499e commit 4b135df
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions assets/js/location.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ async function updateList(event) {
.split(" ")
.map(word => word[0] ? (word[0].toUpperCase() + word.substring(1).toLowerCase()) : word)
.join(" ");
elements.searchBar.value = q;
if (elements.searchBar.value !== q)
elements.searchBar.value = q;

if (q.length < 3) {
if ((event instanceof KeyboardEvent && event.key == "Enter") || event instanceof MouseEvent) {
Expand Down Expand Up @@ -186,7 +187,7 @@ async function updateList(event) {

if (!((event instanceof KeyboardEvent && event.key == "Enter") || event instanceof MouseEvent)) {
pool = q;
await delay(1000);
await delay(500);
if (pool !== q) {
console.log('Skipping to next implementation');
return;
Expand Down
2 changes: 1 addition & 1 deletion pages/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ <h5 class="modal-title text-center">Set your location! | בחר את המיקו
</div>
<i class="bi bi-x-circle-fill" style="display: none" aria-hidden="true"></i>
</span>
<input list="locationNames" autocomplete="postal-code" type="search" id="Main" class="form-control form-control-lg" style="z-index: 2" />
<input list="locationNames" autocomplete="off" type="search" id="Main" class="form-control form-control-lg" style="z-index: 2" />
<datalist id="locationNames"></datalist>
<label class="form-label" for="form1">Insert location name/ZIP code (English only)</label>
<button type="button" data-mdb-ripple-init class="btn btn-success d-none d-lg-block" style="border-top-right-radius: .25rem; border-bottom-right-radius: .25rem;">
Expand Down

0 comments on commit 4b135df

Please sign in to comment.