[Safari] string.length not working

I have the following logic implemented to control the state of the button according to the length of the user text input.

export function phoneInput_input(event) {
    if (isValidPhone($w("#phoneInput").value)) {
        $w("#btnVerf").enable()
    }else{
        $w("#btnVerf").disable()
    }
    
    function isValidPhone (input) {
        return input.length === 8 
    }
}

It had been working fine for months and suddenly stopped working a few day ago.
This issue only happens on Safari.
Could anyone help?

To explain “stopped working”, the current behaviour is that the button is not enabled when the input length is 8, but is enabled when the input length changes from 8 → 7, or 8 → 9.

Hello sir @chaim-kram , I saw you have helped others on safari issue, could you please help to take a look at mine? Thank you very much.