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.
This commit is contained in:
Joffrey JAFFEUX 2023-02-03 20:47:50 +01:00 committed by GitHub
parent 85e1a4934b
commit 232c9d84b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -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",