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

high loading time on low performance smartphones #42

Open
rwkyyy opened this issue Oct 12, 2020 · 4 comments
Open

high loading time on low performance smartphones #42

rwkyyy opened this issue Oct 12, 2020 · 4 comments

Comments

@rwkyyy
Copy link
Contributor

rwkyyy commented Oct 12, 2020

Hi there,

I just noticed that on low end smartphones (or old smartphones), the load time in the checkout selection fields is very big.

I think this is caused by the loading of all the states and cities in the js selector on page load.

Is there a way to make it selective?
eg. select state 1, load just cities A1-Z1;
select state 2, load just cities A2-Z2.

Also, due to this very high load time, if the user clicks the field and accidently types something (the keyboard is not shown ini this state, but android takes the input anyway) and writes something in the field, it will break the selector completely.

Thank you, cheers!

@Mantish
Copy link
Member

Mantish commented Oct 14, 2020

hi, is this a problem with any country or specifically with Romania?

I think it currently does what you mentioned. It only puts the cities into the select when a state is selected.

Maybe disabling the select2 JS library, the performance can be improved...

@rwkyyy
Copy link
Contributor Author

rwkyyy commented Oct 14, 2020

@Mantish it's for any country.

You can have a look here, this one loads cities when the state is selected, it's better to wait at most 1 second for loading, compared to loading all cities on state select.

https://github.com/chitezh/woocommerce_states_places

@Mantish
Copy link
Member

Mantish commented Oct 17, 2020

Hey, I'm not sure I understand what the problem is.
This plugin only loads the cities that belong to the state selected. Isn't that what you'd want?

@rwkyyy
Copy link
Contributor Author

rwkyyy commented Oct 18, 2020

Yes, then I think there is something else wrong.

Steps to replicate:

  1. launch a vm (low spec) with an android OR use a low-end smartphone (I used Samsung Galaxy J7 2017)
  2. go to the checkout on a basic WooCommerce installation
  3. as soon as you have the page loaded try to select a state/city

It will show you the keyboard and allow you to input, but it will not load the dropdown for another few seconds (from my measurements around 5-6 seconds). IF the user inputs anything in the field, it will break the selector and won't load the list anymore.

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

No branches or pull requests

2 participants