patw0929 / react-intl-tel-input

Rewrite International Telephone Input in React.js. (Looking for maintainers, and PRs & contributors are also welcomed!)
https://patw0929.github.io/react-intl-tel-input/
MIT License
284 stars 221 forks source link

Dropdown arrow won't open dropdown #365

Open HamAndRock opened 3 years ago

HamAndRock commented 3 years ago

Clicking on down arrow, won't open the dropdown.

Expected Behavior

When i click right on the arrow symbol the dropdown should open.

Current Behavior

The dropdown won't open

Steps to Reproduce

  1. Click right in middle of dropdown arrow

Environment

nehaljadav commented 3 years ago

This issue is accrues because of class in dropdown arrow element, class in country code element (if separateDialCode is true), if you remove the class from that particular element then it will work perfectly fine.

To solve Arrow Dropdown Click:- In your CSS file add below CSS to solve issue.

.intl-tel-input.allow-dropdown .arrow { display: none; } .intl-tel-input.allow-dropdown .selected-flag:after { content: "\25BC"; font-size: 6px; margin-left: 5px; } .intl-tel-input.allow-dropdown.expanded .selected-flag:after {
content: '\25B2'; }

To Solve Country Code Click:- After intl-tel-input initialize add below code.

setTimeout(() => { document.querySelector('.intl-tel-input .selected-dial-code').classList.remove("selected-dial-code") }, 50);

*If you want to add css for Country Code then you can do like this. .intl-tel-input.allow-dropdown .selected-flag { Your: CSS, }

before after

HamAndRock commented 3 years ago

Yeah unfortunately I don't use separateDialCode={true}, so i dont hate that class there. Just the blue section causing the problem margin section registers the click ok.

image

nehaljadav commented 3 years ago

To solve this issue, just add this CSS to you global CSS file.

Chcete-li tento problém vyřešit, přidejte do svého globálního souboru CSS níže uvedený kód CSS.

.intl-tel-input.allow-dropdown .arrow { display: none; } .intl-tel-input.allow-dropdown .selected-flag:after { content: "\25BC"; font-size: 6px; margin-left: 5px; } .intl-tel-input.allow-dropdown.expanded .selected-flag:after { content: '\25B2'; }

justgeek commented 3 years ago

Just add a global css rule to disable click listeners on arrow class

.arrow { pointer-events: none; }