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

Add basic example for collapsible components #15241

Closed
wants to merge 1 commit into from

Conversation

ianw
Copy link

@ianw ianw commented Nov 27, 2014

Currently the "collapse" documentation jumps straight into the
accordion example and then mentions in passing the slightly simpler
example of using a single component to expand/collapse a region after
that.

This leaves some room for misunderstanding; for example I spent a
while not realising that I'd set data-target in my links, which
makes the page jump around when clicked as the default action isn't
prevented (see [1]).

This proposes a simple example first up, using a link and a button to
expand a div. It also explicitly mentions use of href and
data-target. The more involved accordion example then follows
unmodified.

[1] #2001

Currently the "collapse" documentation jumps straight into the
accordion example and then mentions in passing the slightly simpler
example of using a single component to expand/collapse a region after
that.

This leaves some room for misunderstandings; for example I spent a
while not realising that I'd set data-target in my <a> links, which
makes the page jump around when clicked as the default action isn't
prevented (see [1]).

This proposes a simple example first up, using a link and a button to
expand a div.  It also explicitly mentions use of href and
data-target.  The more involved accordion example then follows
unmodified.

[1] twbs#2001
@cvrebert cvrebert added the docs label Nov 27, 2014
@mdo
Copy link
Member

mdo commented Nov 29, 2014

Something simpler would be awesome, and something even simpler than a list group would be even better. A basic button toggle to show another element would be enough I think.

@mdo mdo added this to the v3.3.2 milestone Nov 30, 2014
@mdo mdo closed this in 9928144 Nov 30, 2014
@juthilo juthilo mentioned this pull request Nov 30, 2014
@ianw
Copy link
Author

ianw commented Nov 30, 2014

@mdo I think the button example is good, but the other point of this proposed change was to also highlight the difference between usage of href and data-toggle. I think that's worth calling out and I'm not the first person to have made that mistake

@mdo
Copy link
Member

mdo commented Nov 30, 2014

@ianw Oh word, misread that part. Perhaps you could open a PR to extend the example I added to include two separate buttons?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants