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
<dynamic-import> that adds HTML Import (<link> tag to the head) when attached (originally imported-template), and does not change element's DOM at all.
What occurred, in Canary (native HTML Imports support?) this.offsetWidth is 0, but for empty <div> with style width: 100%, it should be container - <body> - width.
Under Chrome Stable, and IE it works fine, it also gets corrected after few ms.
Removing wrapping <template> fixes initial width, as well as removing document.head.appendChild line. How and why adding node to the head, affects elements size?
The text was updated successfully, but these errors were encountered:
tomalec
added a commit
to Juicy/imported-template
that referenced
this issue
Jun 27, 2014
I'm not sure whether it is a Polymer or Canary bug, or did I used wrong lifecycle callbacks.
I have created two custom elements:
<my-element>
that needs to know its width when stamped to DOM (originally it was juicy-tile-list)my-element.html
<dynamic-import>
that adds HTML Import (<link>
tag to the head) when attached (originally imported-template), and does not change element's DOM at all.dynamic-import.html
Then I simply pack those to
<template>
:index.html
Full demo is here
What occurred, in Canary (native HTML Imports support?)
this.offsetWidth
is0
, but for empty<div>
with stylewidth: 100%
, it should be container -<body>
- width.Under Chrome Stable, and IE it works fine, it also gets corrected after few ms.
Removing wrapping
<template>
fixes initial width, as well as removingdocument.head.appendChild
line. How and why adding node to the head, affects elements size?The text was updated successfully, but these errors were encountered: