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

2.0 wip: data-toggle=collapse with radio-buttons #1060

Closed
XORwell opened this issue Jan 19, 2012 · 6 comments
Closed

2.0 wip: data-toggle=collapse with radio-buttons #1060

XORwell opened this issue Jan 19, 2012 · 6 comments

Comments

@XORwell
Copy link

XORwell commented Jan 19, 2012

Radio-Buttons dont work properly with data-toggle.
Collapse is working, but the radio-button state wont change.

Example:

<dl class="accordion" id="choice_collapse">
    <dt class="accordion-heading">
        <input type="radio" name="choice" value="1" style="float:left;" data-toggle="collapse" data-target="#t1"> 
        Choice 1
    </dt>
    <dd class="accordion-body collapse" id="t1">Text</dd>
    <dt class="accordion-heading">
       <input type="radio" name="choice" value="2" style="float:left;" data-toggle="collapse" data-target="#t2">
        Choice 2
    </dt>
    <dd class="accordion-body collapse" id="t2">Text</dd>
</dl>
@pokonski
Copy link
Contributor

Can you make a js fiddle with the example? It's much easier for Mark and Jacob to test the issue.

@XORwell
Copy link
Author

XORwell commented Jan 19, 2012

Thanks for the hint.

Link: http://jsfiddle.net/XORwell/kQZ59/14/

@cgunther
Copy link
Contributor

It doesn't work as in the click handler, it's preventing the default handling of the event: https://github.com/twitter/bootstrap/blob/2.0-wip/js/bootstrap-collapse.js#L130

Removing that line would cause the page to jump in the example in the docs since the links use the hash.

@fat
Copy link
Member

fat commented Jan 20, 2012

so i've changed it to only prevent default for targets specified with href, so this should work now for you

@fat fat closed this as completed Jan 20, 2012
@XORwell
Copy link
Author

XORwell commented Jan 20, 2012

great. thx!

daveobriencouk pushed a commit to egocreative/bootstrap that referenced this issue Nov 18, 2012
Using appcache is complicated and can have unexpected consequences if
you do not have a good grasp of the spec. The way that this project
suggested using appcache was likely to be problematic.

Ref twbs#1060
@ghost
Copy link

ghost commented Dec 31, 2012

I am not too sure wether it is still an issue with bootstrap v 2.2.2. I am trying to toggle a content on selection of a radio button. I have not used 'href' as commented by @fat above. Here is my code http://jsfiddle.net/kQZ59/26/ . Any inputs ? Thanks ..

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