Polymer 1.x: Modal paper-dialog appears behind its backdrop -
does have advice fixing problem of modal appearing behind backdrop?
so far, have tried making sure have necessary imports (including <paper-dialog-scrollable>
).
i tried "hack-fix" (suggested someone) involving setting z-index: auto
in css of paper-header-panel
. neither works.
it's worth noting <paper-dialog>
tag works fine. until add modal
attribute.
any ideas?
similar issuesappearing around internet this issue report , this stackoverflow question.
my-element.html<script src="http://www.polymer-project.org/1.0/samples/components/webcomponentsjs/webcomponents-lite.js"></script> <link rel="import" href="http://www.polymer-project.org/1.0/samples/components/polymer/polymer.html" /> <link rel="import" href="../../../bower_components/paper-dialog/paper-dialog.html"> <dom-module id="example-element"> <template> <!-- dialog --> <paper-dialog id="contactdialog" modal> <h2>login</h2> <paper-dialog-scrollable> <form id="contact-form" autofocus> <paper-input autofocus id="name" label="your name"></paper-input> <paper-input id="email" label="email address"></paper-input> </form> </paper-dialog-scrollable> <div class="buttons"> <paper-button dialog-dismiss>cancel</paper-button> <paper-button dialog-confirm>accept</paper-button> </div> </paper-dialog> <!-- button --> <paper-button id="login" data-dialog="contactdialog" on-tap="opendialog">login</paper-button> </template> </dom-module> <script> (function() { polymer({ is: 'example-element', properties: {...}, opendialog: function(){ this.$.contactdialog.open(); } }); })(); </script>
this solution:
opendialog: function(){ var body = document.queryselector('body'); polymer.dom(body).appendchild(this.$.dialogid); this.$.dialogid.open(); }
Comments
Post a Comment