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

slow #42

Open
ghost opened this issue May 8, 2020 · 6 comments
Open

slow #42

ghost opened this issue May 8, 2020 · 6 comments

Comments

@ghost
Copy link

ghost commented May 8, 2020

I am interested in using this library on a page with a list of 200 countries that I want to toggle on and off.
The list is long and when the page loads the list appears to have regular check boxes for about 1 second and then your styled toggles appear. Is that expected? Are there any tweaks you would suggest to speed up the load time?

@Kholodny
Copy link

Kholodny commented May 8, 2020

can you send example?

@sml1990
Copy link

sml1990 commented Jul 13, 2020

I'm having the same experience. Event with 18 toggles, the plain checkbox with no styling is rendered first and then the toggle styling is applied after about a split second. This is a visible and abrupt change from plain checkbox to styled toggle. This is happening on the latest versions of Chrome, Edge (Chromium version), Brave, and Opera at time of writing and my machine is a Ryzen5 six-core with 16GB of RAM running W10. Same issue on my Android phone which is a Pixel running the latest version of Android. It is also happening on this page for me: https://gitbrent.github.io/bootstrap4-toggle/

@sml1990
Copy link

sml1990 commented Jul 14, 2020

After some fiddling about I think the issue is that bootstrap4-toggle.js relies on jQuery to load first before it's able to run and apply the styling to the checkboxes. Any way we can maybe get a vanilla JS file instead of jQuery? Normally I'm a big proponent of jQuery, but the load time seems to be slowing down all of the critical styling functions in bootstrap4-toggle.js.

@sml1990
Copy link

sml1990 commented Aug 26, 2020

Any update on this from anyone?

@jonmnoj
Copy link

jonmnoj commented Oct 14, 2020

@sml1990 Other distributions linked on the main page note that they do not require jQuery, perhaps this one https://github.com/gitbrent/bootstrap-switch-button using ES6 would be what you are after instead?

@cwolcott
Copy link

cwolcott commented Jan 17, 2021

I am having the same issue. I only have 1 toggle button defined. I have tried both bootstrap4-toggle and boostrap-switch-button

When load the page the checkbox is shown before showing the toggle/switch button.

Bootstrap-switch.Init.mov

I agree with @sml1990 and also see it when looking at the page https://gitbrent.github.io/bootstrap4-toggle/. You can see it flash for 10 ms.

Any thoughts?

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

4 participants