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] Dock when screen is big enough #157

Closed
killfill opened this issue Dec 19, 2014 · 12 comments
Closed

[Drawer] Dock when screen is big enough #157

killfill opened this issue Dec 19, 2014 · 12 comments
Labels
new feature New feature or request

Comments

@killfill
Copy link

Hi!

It would be awesome to add a behaviour to the Leftnav, so when the screen is big enough, it shows docked, and when it shrinks it get undocked.

The idea is to hide the AppBar menu icon button when its docked as well.
The left-margin of the app content, could be set by plain media query.

Just like i.e. material.angularjs.org

Thanks!!

@killfill
Copy link
Author

Dont know if this helps, but maybe can be done with window.matchMedia

Or maybe using one of these:
https://www.npmjs.com/package/react-mediaswitch
https://www.npmjs.com/package/react-responsive

@hai-cea hai-cea changed the title Dock LeftNav when screen is big enough [LeftNav] Dock LeftNav when screen is big enough Jun 18, 2015
@antilect
Copy link

+1

I need this functionality for my application. Is it something that's going to be implemented?

@antilect
Copy link

What I'm looking for is the option for a "Persistent" AppBar, from Material's style-guide (scroll down).
https://www.google.com/design/spec/patterns/navigation-drawer.html#navigation-drawer-behavior

@travischoma
Copy link

+1. I tried updating the docked prop on resize, but the component doesn't re-render.

@cgestes
Copy link
Contributor

cgestes commented Jul 19, 2015

@travischoma did you try setState({open: true}) ?

@joebandenburg
Copy link
Contributor

+1

It is possible to build this behaviour on top of LeftNav. Check out my gist.

@josechavezm
Copy link

was this added? material-ui.com has this, how does it do it?

@alitaheri
Copy link
Member

@hiei189 The docs site handles it's own logic.

@callemall/material-ui Guys do you think we should add an example for this or just leave it to the user to handle?

@nathanmarks
Copy link
Member

@alitaheri Until we have a lib-wide system for handling this sort of thing, I think we should leave it to the user rather than promote a suggested way that won't be compatible with any built-in responsive enhancements later on.

@alitaheri
Copy link
Member

You have a good point 👍

@mbrookes mbrookes changed the title [LeftNav] Dock LeftNav when screen is big enough [Drawer] Dock when screen is big enough Mar 25, 2016
@nathanmarks
Copy link
Member

Refer to #3614 for a discussion on adding responsive component + layout support to the lib

@petergzc
Copy link

petergzc commented Jul 19, 2016

here is an example showing how to allow a react component to listen to the media query event provided by javascript by rooting the function in the lifecycle function "ComponentWillMount()", would be a nice reference for you guys

example from react-sidebar

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

No branches or pull requests

10 participants