Safari email address autofill problem

Hello! I have email address and password inputs in a lightbox used to login site members. When viewing my published site in Safari (15.2), Safari correctly suggests an email address to autofill, however when I select this email address, the email address autofill element disappears and the email address input is not populated.

This behaviour does not occur for the password field. If I close and re-open the lightbox, the email address input autofill does function correctly.

Has anyone experienced this? Is this a bug, or an issue with the configuration of the email address input?

Code for the lightbox as below:

import { getLoginToken } from 'backend/login';
import { authentication } from 'wix-members';
import {session} from 'wix-storage';
import wixWindow from 'wix-window';

$w.onReady(function () {

});

export async function authenticateButton_click() {
    let email = $w('#loginEmailInput').value;
    let password = $w('#loginPasswordInput').value;
    $w('#authenticateButton').disable;
    let loginResult = await getLoginToken(email, password);
    if (loginResult.approved) {
        await authentication.applySessionToken(loginResult.sessionToken);
        session.setItem("sessionToken", loginResult.sessionToken);
        console.log("login successful");
        wixWindow.lightbox.close(loginResult.approved);
    } else {
        console.error("login failed");
        $w('#authenticateButton').enable;
    }
}

export function loginEmailInput_viewportEnter(event) {
    setTimeout(() => {$w('#loginEmailInput').focus()}, 1000);
}

export function switchToRegisterButton_click(event) {
    wixWindow.openLightbox("Register");
}

I have tried re-tested the input without the focus() function and the issue persists, so presumably this is not the root cause.

No such behaviour occur in Firefox. I’ve not tested with other browsers yet.

Thanks in advance!