themesberg / flowbite

Open-source UI component library and front-end development framework based on Tailwind CSS
https://flowbite.com
MIT License
7.98k stars 745 forks source link

Phone input country code no working #939

Open spaquet opened 3 months ago

spaquet commented 3 months ago

Describe the bug the phone input country code feature does not work as it does not let the user selects a country code and remains opened with no way to close it.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://flowbite.com/docs/forms/phone-input/#phone-input-country-code
  2. Click on any phone country code
  3. Nothing happens
  4. The dropdown does not close and the phone country code does not change. Once opened, this dropdown does not close or let the user select the proper country code.

Expected behavior when a user selects a country code from the list the dropdown should close and the country code should be selected when a user clicks outside of the list the dropdown should close and the country code should remain the same

Desktop (please complete the following information):

davidmir commented 3 months ago

+1 for this issue, I'm currently handling this using Javascript

spaquet commented 3 months ago

@davidmir I eventually developed the code as a Rails Stimulus controller and consider this as a template more than a component you can use out of the box.

Helixons commented 1 month ago

It seems like that the JavaScript event listeners aren't set up right, I might have a try.

Helixons commented 1 month ago

I have fixed the issue https://github.com/themesberg/flowbite/pull/984

Helixons commented 1 month ago

Hi @zoltanszogyenyi, I've fixed the phone input country code bug, enabling selection, proper closing. I also removed the duplicate Germany entry. Please review and merge https://github.com/themesberg/flowbite/pull/984. Thank you!