Search code examples
polymermaterial-design

How to use paper-dialog polymer element?


I am using the element by adding opening and closing tags <paper-dialog><p>This is it</p></paper-dialog> but it is not getting shown up. Do I need to add some script on top of it so that it should be triggered on some event? Or is there some another way to make it visible ?


Solution

  • The dialog itself is autohidden. You usually toggle it with a button. For example, give the dialog an id="dialog" and make the button on-tap="toggleDialog" , which would be

    toggleDialog: () => {
        this.$.dialog.toggle();
    },