Polymer 1.0 <paper toast> appears behind the <paper panel>
I faced this same problem and found out what was going on.
If you do the same as me, then you have paper-toast
it somewhere inside the section main
paper-drawer-panel
. In this case, move paper-toast
out paper-drawer-panel
.
What worked for me was adding mine paper-toast
in index.html
right after the closing tag </paper-drawer-panel>
.
If you need to use a dynamic message (i.e. the content of the message is defined in a custom element not available in index.html
, then you can set the text in your custom element as shown below.
index.html
<paper-drawer-panel> <!-- Your chest of drawers go here --> </paper-drawer-panel> <paper-toast id="somethingWentWrong" duration="6000"> </paper-toast>
elsewhere.html
<!-- Assuming of course that this is included in index.html --> <p on-click="paragraphClicked">Click Me</p> paragraphClicked: function() { var toast = document.querySelector('#somethingWentWrong'); toast.text = 'Aaargh!'; toast.show(); }
source share