Giter VIP home page Giter VIP logo

Comments (6)

oathcomrade avatar oathcomrade commented on August 20, 2024

I observed the same behavior but strangely enough only in Chrome. It works in Safari 8.0.6 and Firefox 37.0.1.

from paper-toast.

Mygod avatar Mygod commented on August 20, 2024

Fix with:

paper-toast {
    z-index: 9999;
}

from paper-toast.

gthiruva avatar gthiruva commented on August 20, 2024

Looks like the workaround by @Mygod only partly fixes the issue. If the toast is triggered in an attached lifecycle callback, it will only display for a fractional second duration - well short of the 3000 millisecond default duration.

from paper-toast.

valdrinkoshi avatar valdrinkoshi commented on August 20, 2024

Hi,
paper-drawer-panel will filter out anything that is not in drawer or main, so make sure the toast is either outside the paper-drawer-panel or within drawer or main:

<!-- won't display -->
<paper-drawer-panel>
  <div drawer>
    <paper-button raised onclick="document.querySelector('#toast0').show()">Show toast 0</paper-button>
  </div>
  <div main>
    Main
  </div>
  <paper-toast id="toast0" text="toast0"></paper-toast>
</paper-drawer-panel>

<!-- will display! -->
<paper-drawer-panel>
  <div drawer>
    <paper-button raised onclick="document.querySelector('#toast1').show()">Show toast 1</paper-button>
    <paper-toast id="toast1" text="toast1"></paper-toast>
  </div>
  <div main>
    Main
  </div>
</paper-drawer-panel>

There is still an issue if the toast is put inside main: the toast will be cropped. This is being solved in PR #36

from paper-toast.

renfeng avatar renfeng commented on August 20, 2024

@valdrinkoshi Exactly the same problem reproduced with latest Chrome and Firefox. Can you reopen?

from paper-toast.

valdrinkoshi avatar valdrinkoshi commented on August 20, 2024

I've tested with drawer panel as done in #14 (comment), se repro here http://jsbin.com/lopapi/6/edit?html,output (resize window to trigger the hiding of the drawer):

  • when drawer is opened and we try to show the toast in main we won't see it
  • when drawer is closed and we try to show the toast in drawer we won't see it
  • we always see the toast outside drawer-panel

This is due to how stacking context works: both drawer and main create their own stacking context and trap all the content within it. The stacking context of main is below the one of drawer. When main or drawer are hidden (display: none) they hide all their content too.

The solution is to distribute overlays in the topmost stacking context, in this case outside paper-drawer-panel.

Since it is a composition problem, there is not much paper-toast can do about it.

from paper-toast.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.