jackocnr / intl-tel-input

A JavaScript plugin for entering and validating international telephone numbers
https://intl-tel-input.com
MIT License
7.36k stars 1.92k forks source link

setNumber cant be edited on a event listener #1647

Closed jgaviria77 closed 1 month ago

jgaviria77 commented 1 month ago

Plugin version

v23.0.10

Steps to reproduce

  1. send a variable from a js to a iframe with ( frame.contentWindow.postMessage({call:'phone_number', value: "+573156614697"}, 'my twilio url');

)

  1. recieve the varible with

    window.addEventListener('message', function(event){
            var phone_value= event.data.value;
            phoneInput.setNumber(phone_value);
    
          });

Expected behaviour

this should set the set Number method with the variable that i'm sending

Actual behaviour

that just do nothing, and the input don't recieve my variable as input value. i already check that the variable value (+573156614697) are getting received in my iframe correctly.

Initialisation options

setNumber Method