Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not load all countries at first #161

Open
m-avagyan opened this issue Feb 21, 2024 · 1 comment
Open

Do not load all countries at first #161

m-avagyan opened this issue Feb 21, 2024 · 1 comment

Comments

@m-avagyan
Copy link

Countries list do not loaded lazyly.
The countries all list loaded at first at dropdown.

Intersection observer
Using intersection observer we can get if latest element is visible and loaded next countries data.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Performance issues
This happen a excessive DOM size issue

@Sayvai
Copy link

Sayvai commented Jun 28, 2024

I agree. Maybe a virtualised solution to load the list of countries works best(?)

There is noticeably perceptible ~2/3 second delay of rendering the list of countries for each subsequent click to render the countries, which is typically noticeable after the first render of the countries, only when i have Chrome Dev Tools open within the page.

Rendering the list of countries from dropdown select with Chrome Dev Tools open

react-international-phone-countries-slow-render-with-dev-tools

However, when Chrome Dev Tools is not open, the countries list load performance is much better, although i can somewhat still notice a slight lag, which is just about acceptable(?), but definitely not optimal, and could be improved for a much more snappy user experience ⚡🙏

Rendering the list of countries from dropdown select with Chrome Dev Tools closed

react-international-phone-countries-slow-render-no-dev-tools

I suppose it could also be machine resource dependent too, whether system resource usage (e.g. CPU) is peaking at the time of interaction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants