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

[BUG] Toggle is initially shown as checkbox before displaying correctly #193

Closed
cwolcott opened this issue Sep 14, 2024 · 2 comments
Closed
Labels
question Further information is requested

Comments

@cwolcott
Copy link

Describe the bug
Has anyone seen this before?
When the toggle is initially displayed on the browser it is shown as a checkbox and then shows as a toggle.

To Reproduce
I have not produced an independent exmaple yet.

<input checked id="taxonomyMap" type="checkbox" data-toggle="toggle" data-size="sm" data-height="30" data-width="163" data-style="slow mt-2" data-onlabel="<i class='fa fa-earth-americas fa-spin' style='--fa-animation-duration: 6s;'></i>  Show Map" data-offlabel="<i class='fa fa-ban'></i>  Hide Map">
Nothing special dealing with the toggle element

Expected behavior
I wouldn't expect to the the toggle flash as a checkbox first.

Screenshots
If applicable, add screenshots to help explain your problem.
BeforeAsCheckBox
AfterasToggle
Video showing toggle initializing

Package:

  • Bootstrap 5 Toggle version: [5.5.1]
  • Bootstrap version: [5.3.2]

Desktop:

  • OS: macOS Sonoma 14.6.1
  • Browser: Chrome
  • Version: Version 128.0.6613.138

Additional context
None

@cwolcott cwolcott added the bug Something isn't working label Sep 14, 2024
@luz-arreola
Copy link

I have seen this. I think that this could be solved by setting the control to hidden with CSS and then having JQuery (or JS) show it after the control has been rendered.

What this would do is show nothing until after the control is fully rendered.

@palcarazm palcarazm added question Further information is requested and removed bug Something isn't working labels Dec 8, 2024
@palcarazm
Copy link
Owner

The auto-render base on html properties is fired once when the page is loaded :

  • If the checkbox is added after the auto-render have being fired, it will be render has a checkbox.
  • If your page load slowly, you can view a flash of the checkbox and then the toggle.

@palcarazm palcarazm closed this as not planned Won't fix, can't repro, duplicate, stale Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants