Asked By: Anonymous
I’m building my first polymer/material design webapp. In it, I’m using a
core-drawer-panel. It’s normal behaviour is that it is opened on large screens, but I want it to behave the same on large screens as on small screens. Is this possible?
<body> <core-drawer-panel id="drawerPanel" rightDrawer> <core-header-panel drawer> <core-toolbar id="navheader'"> <span>Menu</span> </core-toolbar> <core-menu> <core-item label="One"></core-item> <core-item label="Two"></core-item> </core-menu> </core-header-panel> <core-header-panel main> </core-header-panel> <core-drawer-panel> <body>
Answered By: Anonymous
In the latest release of the polymer core elements (0.5.0), there’s a new attribute you can set to
forceNarrowwhich forces the panel to always be narrow no matter what width or responsive width it deals with.
If this is what you need, just do this:
You can try changing the
responsiveWidth attribute to something absurdly large.
responsiveWidth attribute specifies at what width do you want the core-drawer-panel to be opened by default.
This means that above
500px the core-drawer-panel will be open and below
500px the panel will be closed and you’ll have to toggle it on and off either by swiping or pressing a menu button you hooked onto it.