Giter VIP home page Giter VIP logo

Comments (7)

samccone avatar samccone commented on July 19, 2024

so lets step down the inheritance chain of fun 👷

Based on my reading of the source... yes this should work (should being the key word) let me step through my thinking...

paper-toast uses iron-overlay-behavior
https://github.com/PolymerElements/paper-toast/blob/master/paper-toast.html#L124

Which uses IronFitBehavior
https://github.com/PolymerElements/iron-overlay-behavior/blob/master/iron-overlay-behavior.html#L435

Then looking at iron fit behavior

https://github.com/PolymerElements/iron-fit-behavior/blob/master/iron-fit-behavior.html#L201

It should expose a "contrain" fn on the paper-toast element... however when I try to invoke it

image

note how it is undefined :(

So here in is the mystery, and I think the bug, or just a lack of understand on my part :(

from paper-toast.

valdrinkoshi avatar valdrinkoshi commented on July 19, 2024

@samccone, in v1.1.3 you should be able to see the method defined
screen shot 2016-01-25 at 10 53 14 am

The issue is related to the fact that paper-toast will set its bottom, left css properties, and iron-fit-behavior should handle those. I'll further investigate to see what's going on..!

from paper-toast.

samccone avatar samccone commented on July 19, 2024

awesome thanks!

from paper-toast.

valdrinkoshi avatar valdrinkoshi commented on July 19, 2024

Alright, so this should do the trick http://jsbin.com/rezeru/2/edit?html,output

#fitElement {
  border: 1px solid red;
  padding: 10px;
  position: relative;
}
#toast {
  position: absolute;
}

Even if paper-toast extends iron-overlay-behavior, it limits its features, in order to be always shown on the bottom of the viewport. I'm not sure we should change its position: fixed to position: absolute (even then you'd need to set the parent's position to relative)
cc/ @cdata

from paper-toast.

valdrinkoshi avatar valdrinkoshi commented on July 19, 2024

Update: even simpler, you just have to create a new stacking context for #fitElement http://jsbin.com/rezeru/3/edit?html,output

#fitElement {
  border: 1px solid red;
  padding: 10px;
  transform: translateZ(0);
}

from paper-toast.

beckula avatar beckula commented on July 19, 2024

Is there a version of this solution that doesn't require the Polymer user to have to set fitInto as well as update their container and toast's CSS? Even if that's well documented someone's going to miss it. :)

from paper-toast.

valdrinkoshi avatar valdrinkoshi commented on July 19, 2024

paper-toast is meant to display on the bottom left by default, so some kind of setting needs to be done by the Polymer user to change the default behavior.
I'm not satisfied with the solution I suggested because it relies on the fact that paper-toast is a child of its fitInto.
The proper way should be that paper-toast shows at the bottom left of its fitInto element; this doesn't require paper-toast to be a child of fitInto.

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.