-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Explicitly set display none on dom-* elements (#4821)
- Loading branch information
1 parent
1a32f4d
commit 65859b1
Showing
4 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,6 +67,7 @@ | |
} | ||
|
||
connectedCallback() { | ||
this.style.display = 'none'; | ||
this.render(); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<link rel="import" href="../../polymer.html"> | ||
</head> | ||
<body> | ||
|
||
|
||
<dom-module id="my-element"> | ||
|
||
<template> | ||
<style> | ||
:host { | ||
display: block; | ||
} | ||
.parent { | ||
border: 1px solid red; | ||
justify-content: space-between; | ||
width: 300px; | ||
display: flex; | ||
} | ||
.child { | ||
border: 1px solid green; | ||
width: 100px; | ||
} | ||
</style> | ||
<div class='parent'> | ||
<div class='child'>Child1</div> | ||
<template is='dom-if' if='1'> | ||
<div class='child'>Child2</div> | ||
</template> | ||
</div> | ||
</template> | ||
|
||
|
||
<!-- Uncomment for class syntax --> | ||
<script> | ||
class MyElement extends Polymer.Element { | ||
static get is() { return 'my-element'; } | ||
static get properties() { | ||
return { | ||
prop: { | ||
type: String | ||
} | ||
} | ||
} | ||
constructor() { | ||
super(); | ||
this.prop = 'my-element' | ||
} | ||
} | ||
customElements.define(MyElement.is, MyElement); | ||
|
||
</script> | ||
|
||
</dom-module> | ||
|
||
<my-element></my-element> | ||
|
||
</body> | ||
</html> |