Skip to content

Size error on render hidden checkbox #92

Answered by palcarazm
edika99 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @edika99 and @g-pane,

I let you a code pen with 2 workarounds for this issue.

Work around 1: render on show

Skip render on load with data attribute data-toggle="skip-toggle" and render the toggle on show with:

$('#my-selector').onclick((e)=>{
  // Add display to element
  $('#my-toggle').bootstrapToggle();
});

Work around 2: destroy and render on show

Destroy and render the toggle on show with:

$('#my-selector').onclick((e)=>{
  // Add display to element
  $('#my-toggle').bootstrapToggle('destroy');
  $('#my-toggle').bootstrapToggle();
});

I'll look for a better fix for the issue, but for the moment I think it can be a good solution.

Replies: 10 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by palcarazm
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
3 participants
Converted from issue

This discussion was converted from issue #91 on December 23, 2022 17:03.