You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using <template is='dom-if'> in source code causes <dom-if> element to be put in resulting HTML (regardless of whether the condition is true or false).
If the parent element has justify-content: space-between; display: flex; then <dom-if> participates in element count for justification sake and the result looks broken.
This can be fixed by styling <dom-if> with display: none. Since this is a regression from Polymer 1.9, maybe the library can apply this automatically? I can't think of a use case where one wouldn't want display: none on the <dom-if>
The reason it regressed in Polymer 1 vs 2 is that in Polymer 2 the <template is="dom-if"> is transformed into a <dom-if>. This means that it is an actual custom element and not inert, thus it participates in the CSS styling counts. Since is= was not implemented (see the long discussion in WICG/webcomponents#509 for more information), dom-if can't take advantage of the properties of template in 2.0.
To resolve this, we could maybe force styling on dom-if to resolve this:
:host {
display: none;
}
I am not 100% sure this will work because of CSS priorities and specificity.
Description
Using
<template is='dom-if'>
in source code causes<dom-if>
element to be put in resulting HTML (regardless of whether the condition is true or false).If the parent element has
justify-content: space-between; display: flex;
then<dom-if>
participates in element count for justification sake and the result looks broken.This can be fixed by styling
<dom-if>
withdisplay: none
. Since this is a regression from Polymer 1.9, maybe the library can apply this automatically? I can't think of a use case where one wouldn't wantdisplay: none
on the<dom-if>
Live Demo
http://jsbin.com/megukipana/1/edit?html,output
Steps to Reproduce
Example:
Expected Results
Child1 is to the left, Child2 is to the right.
Actual Results
Space to the right if Child2 caused by empty
<dom-if>
Browsers Affected
Versions
The text was updated successfully, but these errors were encountered: