-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add API for communicating hide/show/resize from parents to interested children #849
Comments
+1billion |
What about more lifecycle callbacks? |
New The following elements were upgraded to use these mixins:
|
@kevinpschaaf Great! Do you know when this will be released? |
I'm not sure this is fixed in all cases. For example if you look at http://jsbin.com/kezito in chrome (latest) it shows no rows until you manually resize the window. If you try on firefox and safari they show 4 rows till the window is resized. Note I am referencing the core elements directly from http://www.polymer-project.org/components which I assume is now 5.2 |
I've updated to latest 5.2, still have the same problem |
@kevinpschaaf Will it also be added to core-pages (above Strawman point 2)? I have a couple of forms in different core-page items and I want to set focus to the first input field of the form of whatever core-page item that is shown. Current workaround is a setTimeout. |
My workaround is to add a listener to the data object passed to core list and whenever it changes call updateSize. Works most of the time but not all |
@torsjonas The problem in the jsbin is actually not related to the resize/updateSize topic in this issue, it is because You are trying to put a
Note, this is also the technique used in the sample in the core-list demos folder: |
Thanks @kevinpschaaf for the detailed explanation. I am trying to apply this to my application. One of my challenges is that my application is broken into several separate polymer elements (for modularity) which complicates things. So to simplify things, I took the demo messages example you listed (which ui layout wise is very much what I'm trying to do) and attempted to evolve it into the structure I want. First I extracted the list and fab into a separate component but ran into a strange issue |
Issue by kevinpschaaf
Friday Oct 17, 2014 at 03:06 GMT
Originally opened as https://github.com/Polymer/polymer-dev/issues/113
There is a small class of elements that need to measure themselves to perform proper layout, when pure CSS alone is not sufficient (e.g. tooltip or virtual list). Since renderers skip layout when a subtree is
display:none
and measurements such asoffsetHeight
/offsetWidth
return 0 in that case, such "measuring" elements must defer their measurement/layout until a point at which they (and all of their parents) are visible.There is a general problem with the web platform in that there is no event/API an implementer can listen for to know when children have been hidden or shown by virtue of a parent being hidden/shown (e.g. by display:none on an inline-style or class), and so such elements have no way of knowing when to perform measurement and layout. A similar problem exists in that a child has no way of knowing whether it may have been resized outside of its purview, in which case its measurements may have been invalidated and need to be updated.
This task is to implement a best-effort API that two classes of elements can opt-in to using, to solve this platform deficiency. Strawman as follows:
Above strawman is clearly not silver bullet-- both measurer and measuree must opt in to same scheme, but could make common use cases with cooperating elements "just work."
The text was updated successfully, but these errors were encountered: