From 232c9d84b7d306715dfd9b8cdd77fc7c1bf37613 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Fri, 3 Feb 2023 20:47:50 +0100 Subject: [PATCH] FIX: autocomplete showing under keyboard on android (#20168) Fixed had been added when autocomplete was used in the discourse header. This shouldn't be needed anymore. This was causing the preventOverflow to not work correctly on Android. This fix fix also adds an optimisation to refer top of the input when on mobile. This is done to avoid cases where the screen is actually slightly taller than the viewport with keyboard visible on Android leading popper to think there's space under the input. --- app/assets/javascripts/discourse/app/lib/autocomplete.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/app/lib/autocomplete.js b/app/assets/javascripts/discourse/app/lib/autocomplete.js index 1f71e2cc3ae..3041ec78500 100644 --- a/app/assets/javascripts/discourse/app/lib/autocomplete.js +++ b/app/assets/javascripts/discourse/app/lib/autocomplete.js @@ -385,8 +385,7 @@ export default function (options) { if (isInput || options.treatAsTextarea) { _autoCompletePopper && _autoCompletePopper.destroy(); _autoCompletePopper = createPopper(me[0], div[0], { - placement: "bottom-start", - strategy: "fixed", + placement: `${Site.currentProp("mobileView") ? "top" : "bottom"}-start`, modifiers: [ { name: "offset",