I have an app-drawer in my code:
<app-drawer-layout fullbleed force-narrow>
<app-drawer swipe-open opened="{{drawerOpened}}">
...
</app-drawer>
And the drawer always glitching (opens and closes) for like 0.2 second while site is loading its shell (app-toolbar, app-drawer, etc.). I can see these glitches in the edge and firefox (sometimes) browsers.
So I decided to fix it by adding visibility:hidden
:
<app-drawer swipe-open opened="{{drawerOpened}}" style="visibility:hidden;">
...
</app-drawer>
and make is visible again in 2 seconds after the page's shell is loaded(-ish):
setTimeout(function(){
$(document).ready(function() {
$("app-drawer").css( "visibility", "visible;" );
});
},2000);
But this jquery code does not making it visible.
While searching the internet I found that I need to use Polymer.dom(this.root).querySelector
instead of using $("app-drawer")
, but I have no idea how to implement it in this code, since I'm a beginner. Any help?