jackocnr / intl-tel-input

A JavaScript plugin for entering and validating international telephone numbers. React and Vue components also included.
https://intl-tel-input.com
MIT License
7.62k stars 1.94k forks source link

Position Dropdown Container? how to? #1825

Closed SalmaBegumJSR closed 2 weeks ago

SalmaBegumJSR commented 2 weeks ago

Greetings,

i like to position the drop down container (the country selector) like follows: (above the phone number input-box)

but i can't figure it out.. any help please

image

thanks in advance best regards

jackocnr commented 2 weeks ago

We decided not to support having the dropdown appear above the input because of the search input, which would jump up and down as you typed and the countries filtered out. So this is not possible I'm afraid.

SalmaBegumJSR commented 2 weeks ago

@jackocnr thanks a lot for your kind reply..

i am sorry, but i think it's possible very easily and you can just add few more options, like:

  1. fixed height: so, if case even if the search results shows limited 1/2 items, but the height of the container will be same
  2. disable search input: user can disable the search function at all, so, it won't be a problem also

i hope that make sense?

please sir, consider above point and allow that position control, because in my case.. it's not working properly on it's current position

thanks in advance

best regards

jackocnr commented 2 weeks ago

Can you help me understand your use case - why this is required? Please include a screenshot of your page.

SalmaBegumJSR commented 2 weeks ago

thanks a lot for your reply..

please check the attached screenshot, it will help you to understand my case better

  1. the stage where your widget is not invoked issue-001

as you see, as i am using accordion it's calculate the required space and for the content of the active one.

  1. the stage when user/me try to click/open the country selector, a scroll bar is comes up issue-002

  2. now me/user need to scroll down to see the list issue-003

i hope how you understand my case?

thanks in advance

best regards

jackocnr commented 2 weeks ago

So if I understand correctly, it's not that the dropdown goes below the bottom of the page, it just goes below the bottom of the section it's in. In this case, I would recommend using the initialisation option dropdownContainer: document.body which should allow the dropdown to appear above the section below. Does that solve your problem?

SalmaBegumJSR commented 2 weeks ago

i just checked, that's somehow works.. but not as a optimal solution..

as you can see in the following screenshot that it's cover/blocks the bottom/below area/message/elements..

issue-004

hope that make sense

once again.. thanks a lot for your kind response/support

best regards

jackocnr commented 2 weeks ago

Yes, but this is how dropdowns work - they always cover whatever is below the input. But it's ok because they are temporary - it's obvious that it has appeared because you clicked the selected country, and it's obvious how to close it again - you pick a country, or you click-off-to-close, and it's gone again.

SalmaBegumJSR commented 2 weeks ago

ok.. thanks a lot for your kind support