Skip to content

Commit

Permalink
Fix wrong position of city dropdown menu on iPhone
Browse files Browse the repository at this point in the history
  • Loading branch information
smintank committed May 20, 2024
1 parent 6dc3733 commit b8f77cd
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions backend/static/js/main-WCi7f0ZE.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,13 @@ const useCitySuggestions = () => {

function updateDropdownPosition() {
const rect = cityField.getBoundingClientRect();
const scrollTop = window.scrollY || document.documentElement.scrollTop;
const scrollLeft = window.scrollX || document.documentElement.scrollLeft;

if (dropdown) {
dropdown.style.top = `${rect.bottom}px`;
dropdown.style.left = `${rect.left}px`;
dropdown.style.position = 'absolute';
dropdown.style.top = `${rect.bottom + scrollTop}px`;
dropdown.style.left = `${rect.left + scrollLeft}px`;
dropdown.style.width = `${rect.width}px`;
}
}
Expand All @@ -245,7 +249,6 @@ const useCitySuggestions = () => {
return function(...args) {
const later = () => {
clearTimeout(timeout);
updateDropdownPosition();
func(...args);
};
clearTimeout(timeout);
Expand Down

0 comments on commit b8f77cd

Please sign in to comment.