bootstrap4-toggle icon indicating copy to clipboard operation
bootstrap4-toggle copied to clipboard

Toggle style returns to normal checkbox intermittently

Open WebCoderUk opened this issue 5 years ago • 8 comments

On some reloads the style for the toggles changes back to a normal checkbox anyone else experienced this and have a fix?

WebCoderUk avatar Dec 03 '19 22:12 WebCoderUk

This is news to me. If anyone else is experiencing this, feel free to chime in.

gitbrent avatar Dec 06 '19 01:12 gitbrent

Happens to be whenever I put it in a v-for loop using vuejs.

DaveInTO avatar Dec 09 '19 16:12 DaveInTO

While using it, if I navigate directly to the page it renders, but when routing it displays as a normal checkbox. I am using Angular 8

p4k1tz avatar Dec 14 '19 16:12 p4k1tz

I tried loading the js in the onInit method, and that would render the toggle, but on a page reload or direct route, it would not toggle. The fix for me was to use the bootstrapToggle API to set it to on or off in the onInit method. It is a bit clunky to work that way since you have to mind the initial state and change it on init, but it works.

p4k1tz avatar Dec 14 '19 20:12 p4k1tz

Using the Initialize with JavaScript option seems to have solved the issue on my part, issue only happens when you use the Initialize with HTML option

josmanalastas avatar Jan 30 '20 04:01 josmanalastas

the issue happened to mee too. i have multiple toggle buttons, that has exact same code, most of them loads, and some stay as a checkbox, when i reload the page, they all reload!

xbaha avatar Jun 14 '20 12:06 xbaha

I'm having a similar experience. Event with 18 toggles on the same page, 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 avatar Jul 13 '20 10:07 sml1990

It's clearly a bug, no consistent behavior, but it always happens. I gave up on this version and moved to bs5 where it has toggle supported natively.

xbaha avatar Jul 13 '20 15:07 xbaha