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

[Drawer] Mini variant with SwipableDrawer #19606

Open
1 task done
tomas-c opened this issue Feb 7, 2020 · 4 comments
Open
1 task done

[Drawer] Mini variant with SwipableDrawer #19606

tomas-c opened this issue Feb 7, 2020 · 4 comments
Labels
component: drawer This is the name of the generic UI component, not the React module! new feature New feature or request

Comments

@tomas-c
Copy link

tomas-c commented Feb 7, 2020

There's an example in the docs on how to make a small drawer with only icons shown that can be expanded to its full width.

Super useful on small screens. Unfortunately, this doesn't seem possible to implement with SwipableDrawer.

  • I have searched the issues of this repository and believe that this is not a duplicate.

Summary 💡

If there was a way to keep the content of the swipable drawer in the dom when it's closed, then a similar example to that in the docs could be used.

Motivation 🔦

Mini drawers are useful on small screens. Small screens usually have touch capabilities so people naturally want to open/close drawers by swiping.

@mbrookes mbrookes added new feature New feature or request component: drawer This is the name of the generic UI component, not the React module! labels Feb 7, 2020
@tomas-c tomas-c changed the title Mini variant drawer with SwapableDrawer Mini variant drawer with SwipableDrawer Feb 10, 2020
@TommyJackson85
Copy link
Contributor

TommyJackson85 commented Feb 10, 2020

I'm gonna try and add a swipable function from the swipabledrawer api to a Mini Variant Drawer sandbox.
Might be better to keep it as a separate component on the Drawer page. Maybe call it:
Swipeable Mini variant drawer.

@TommyJackson85
Copy link
Contributor

TommyJackson85 commented Feb 11, 2020

Somebody take a look at this sandbox:
https://codesandbox.io/s/ts3f6

I am able to open and close it from clicking it, but I am not able to swipe it close on mobile. Is there anything I am missing in the Sandbox or is there anything that is overriding it like props? I used the mini variant drawer as a base template and just added some of the props from the swipeable api documentation, while also using its demo for comparison.

From what I think, the fact we are styling it to close slightly might be the problem. This issue #13361
Which has been fixed, and highlights the potential use of SwipeAreaProps.
Could SwipeAreaProps be used to instead of the styling to make it slightly open when closed?

Just doing this first to know my limitations, before creating a PR.

@TommyJackson85
Copy link
Contributor

TommyJackson85 commented Mar 7, 2020

I noticed from the console of the the SwipeableDrawer sandbox example, the Mui-drawer modal dissapears when closed:
@oliviertassinari can you tell me if this is true and if there is a way to keep it open when closed to allow for styling to make it a mini variant version as closed?

Closed:
Screenshot 2020-03-07 at 13 53 09

Open:
Screenshot 2020-03-07 at 13 25 08

@ulfimlg
Copy link

ulfimlg commented Jun 20, 2020

Is there any update on this issue? I am looking for the same solution.

@oliviertassinari oliviertassinari changed the title Mini variant drawer with SwipableDrawer [Drawer] Mini variant with SwipableDrawer Aug 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: drawer This is the name of the generic UI component, not the React module! new feature New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants