Closed gitrpbrme closed 1 month ago
remove this: window.intlTelInput.loadUtils("https://cdn.jsdelivr.net/npm/intl-tel-input@24.5.0/build/js/utils.js");
You are adding utilsScript two times
Hi, Thanks for the help. I have comment the first import and used the second one, I just kept it so I can show I tried different approaches.
Why is it dropdownContainer: input
? That’s incorrect; it should be document.body
or any container element.
dropdownContainer: document.body, // or any specific container element
Remove dropdownContainer
from your options to fix the issue, or assign a container element instead of input
.
Hi Sir, Thanks again for the help. I have kept things as simple as possible now, but still not good.
The way I have programmed this was first I have created the model a pure .html simple file, then I transported this code to inside the website structure. I guess there is something to do with that darn popup that doesn't let me make it work.
I have recorded a simple video to highlight this behavior, so you don't have to go through the steps to reproduce: https://youtu.be/ze4tgFmztLM
Here is how I kept it :
var input = document.querySelector("#telefonewhatsapp");
var intl = window.intlTelInput(input, {
utilsScript: "https://cdn.jsdelivr.net/npm/intl-tel-input@24.5.0/build/js/utils.js",
separateDialCode: false,
initialCountry: "br",
});
I have tried different setups, but like I said, as it works on pure .html format, it's definitely something with that popup that not even with the plugin creators we were able to solve it.
Please assist.
Please can you try adding dropdownContainer: document.body
, as suggested by @rashadmehtab - this should fix the issue with the dropdown not showing when there's a popup.
Hi jackocnr, Thanks for your insights, I have tried dropdownContainer: document.body without any luck on solving this as well. I have tried setting different elements on dropdowncontainer as well, but it didn't work. Not sure what I'm missing to make this work on this popup, because on pure html it works.
If you can find the minimal set of code that reproduces the problem and put that in a CodePen, then I'd be happy to take a look. Here is an example pen with the plugin up and running - feel free to fork this if it helps.
Closing due to inactivity.
Hi Team, Just to wrap up, we decided not to use intl-tel-input on this popup as it's complicated. You can close it, thanks for the help and sorry for the trouble.
Plugin version
24.5.0
Steps to reproduce
Expected behaviour
I expected that the dropdown of countries would show up. I have made it work using regular html and js, but I'm not able to figure out how to open up on this popup.
Actual behaviour
I would expect the dropdown to show.
Initialisation options
List any options you're using e.g. utilsScript or onlyCountries
Last but not least, due to this popup, I had other problems with JQuery that I had to use to figure out the option selected on a select, I had to use code var $option = $(this).find('option:selected'); var value = $option.val(); // to get content of "value" attrib var text = $option.text(); // to get content
But, I'm trying to figure out the kind of workaround I use for this other problem and how to accomplish with Intl-tel-input.
PS: The website is in development, so you need to enter email to get 2fa code from Cloudflare.