paper-drawer-panel icon indicating copy to clipboard operation
paper-drawer-panel copied to clipboard

open-, close- and togglePanel should *always* work

Open liebrand opened this issue 9 years ago • 6 comments

Currently the open-, close- and togglePanel functions only work on mobile (eg narrow mode). I want to be able to open/close the drawer on desktop as well. In other words, I want to have my drawer behave the way that Google's Inbox drawer works as well.

The drawer should still default to closed on mobile (and the main page should still dim when the drawer is opened on mobile), but the decision to open/close/toggle based on the responsiveWidth currently is a bug IMHO

liebrand avatar Oct 20 '15 23:10 liebrand

As a workaround you could do something like this in paper-drawer-panel.

http://jsbin.com/lunixiholu/edit?html,output

frankiefu avatar Oct 21 '15 00:10 frankiefu

Ah, I have a workaround using forceNarrow, but didn't hook up it up a media query (so my workaround doesn't work on mobile). Thanks for the suggestion!

liebrand avatar Oct 21 '15 01:10 liebrand

I'm with liebrand about this. I need the close and open functions to work when im on a desktop layout and not respond only to the narrow mode. In my app i've got some sections to show my works(i'm an illustrator), and it's convenient to use all the screen possibles in this sections and close the drawer. Also i suggest that the drawerToggleAttribute need to be optional if you wanted to hide.

ghost avatar Oct 31 '15 02:10 ghost

I would like close the drawer on desktop. :+1:

Nice solution have Google Plus, check out the https://plus.google.com

JosefJezek avatar Dec 31 '15 13:12 JosefJezek

Take a look at my master branch, I made some modifications about toggle feature on desktop, tell me what you think. Demo is here. To summarize :

  • drawerWidth attribute replaced with var --paper-drawer-panel-drawer-container-width
  • remove the needs of _computeMainStyle() & _computeDrawerStyle()
  • transitions are added on attached instead of on ready because #main default to left:0 and #main:not(.iron-selector) default to left:256px. As iron-selector class is added after ready (but before attached), left was translating from 256 to 0px on first render
  • some style modifications for the drawer to toggle on desktop
  • make the toggle button desapear when drawer is opened on desktop

Zecat avatar Jan 03 '16 18:01 Zecat

I tried to embed paper-drawer-pane in existing GWT application - no matter what I tried toggle is not working. I tried every method etc.. No JavaScript errors generated - just not working. How funny... Most of other Polymer components are fine.

vitalygoji avatar Feb 14 '17 02:02 vitalygoji