kuasha420 / react-native-paper-phone-number-input

A performant phone number input component for react-native-paper with country picker
MIT License
6 stars 1 forks source link

Flags are not visible on web #2

Closed OmarThinks closed 1 month ago

OmarThinks commented 2 months ago

Thanks a lot for creating this awesome package.

But if you can display the flags on web that will be amazing.

kuasha420 commented 2 months ago

Hi, the flags are actually unicode emojis and should render on all modern system. Can you check if the flags are loading on the example app by cloning the repo and running yarn && yarn example web?

OmarThinks commented 1 month ago

Hello, @kuasha420 ! ๐Ÿ‘‹ I tried. And the error is also there. ๐Ÿ˜

kuasha420 commented 1 month ago

Hello :wave:

Can you tell me which OS and Browser are you using? I can see everything Fine in Firefox and Chrome in Linux.

I'm assuming your system doesn't come with a Emoji font installed that has the flags. If you provide further info, I can try and see if we can include a web font for compat reasons.

Cheers.

Screenshot_20240710_160110

OmarThinks commented 1 month ago

Hello, @kuasha420 ! ๐Ÿ‘‹ Thanks a lot for your patience and cooperation. I'm more than grateful. ๐Ÿ˜๐Ÿซกโœ…๐Ÿ’ฏ

OS: Windows Browser: Chrome and Edge Note: (I just found out that the Flags are visible on Firefox)

Screenshot 2024-07-12 115123

kuasha420 commented 1 month ago

Hi @OmarThinks. Thanks for providing the details. :muscle:

I've done some research on this, and yes, Microsoft intentionally doesn't include emoji flags in their emoji font. Common Microsoft L there.

Firefox gets around this by bundling Twemoji font themselves. That's why it work in Firefox even in Windows but not Chromium Based browsers.

To get around this, I'd recommend using this polyfill. Try it out and let me know if this works. I don't have a Windows machine at hand to test this.

If this solves the issue, I'll add a note about this in the Readme.

Cheers. :heart:

kuasha420 commented 1 month ago

Hi @OmarThinks :wave:

Can you try #5 PR and see if this fixes the issue in Windows for you? You also need to follow the documentation for Windows here.

Cheers.