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

Adds Sidebar Drawer Option On Modal #21540

Closed
wants to merge 1 commit into from

Conversation

judetucker
Copy link

Per this comment #21390 (comment) regarding adding a drawer to the framework, I thought I'd offer up the solution that we have been using in prod on V4 for a while.

This attaches the Drawer to the .modal rather than the .collapse to take advantage of the modal backdrop. It can be used as an alternative look to the regular modal dialog and as an option for those looking for an off-canvas nav.

drawer

@mdo
Copy link
Member

mdo commented Jan 4, 2017

Whoa, this sounds awesome.

@mdo mdo added this to the v4.1 ideas milestone Jan 4, 2017
@Johann-S
Copy link
Member

Johann-S commented Jan 5, 2017

Great work but I think it's bit strange to not create a new component. Why build this feature on Modal component instead of creating a new one ?

@mdo
Copy link
Member

mdo commented Jan 5, 2017

To me, it's either the modal, the navbar, or the collapse. I'd also take an independent plugin that simply toggles a class somewhere though 😆 (like a more basic "collapse").

@judetucker
Copy link
Author

Honestly, I tacked it onto Modal because it didn't add any new JS to the code and it provided the modal-backdrop, which helps draw the focus to the drawer. (andd because my JS isn't the strongest 🤐 )

@giulianovelli
Copy link

IMHO this should its own component and not tied to other components (modal, navbar and so on). These drawers have become really commonplace and it's probably the biggest bootstrap omission right now. While the effect shown in this page it's cool it's also very different from how drawers usually behave in apps and websites (pushing the content while opening of just covering it without light effects)

@LauLogisch
Copy link

Great idea!
I think the default page should slide to the other side so this can be also used on mobile devices.
Dragging the page to the right making the navigation visible or with a button.

@mdo
Copy link
Member

mdo commented Jul 2, 2017

/x-ref for #17496 just in case

@mdo mdo mentioned this pull request Nov 14, 2017
@XhmikosR XhmikosR removed this from the v4.1 ideas milestone Oct 23, 2018
@XhmikosR
Copy link
Member

XhmikosR commented Oct 23, 2018

@mdo: I rebased this and cleaned it up, minus a couple of linting issues.

EDIT:

It seems we have #27035 for the same functionality.

@Johann-S
Copy link
Member

The same question remain I don't think we should tweak our Modal to do a Drawer, we should build a new component which will be called Drawer

@XhmikosR
Copy link
Member

Well, if you can refactor the code to be shared, sure. Otherwise there will be a lot of duplication.

@XhmikosR
Copy link
Member

But anyway I feel like #27035 is a little better.

@XhmikosR
Copy link
Member

Closing since this will be a new component.

@XhmikosR XhmikosR closed this Oct 23, 2018
@viktorsmari
Copy link

Can you reference this new component here @XhmikosR ?

@XhmikosR
Copy link
Member

There's nothing to reference yet.

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

Successfully merging this pull request may close these issues.

8 participants