-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set
display:none
in addition to hidden
attribute when hiding elem…
…ents inside a shadow root (#9026) Set `display:none` in addition to `hidden` attribute when hiding elements inside a shadow root Fixes #8256
- Loading branch information
Johannes Eriksson
committed
Sep 23, 2020
1 parent
92a6d0a
commit 58f343b
Showing
10 changed files
with
305 additions
and
8 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
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
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,15 @@ | ||
import {PolymerElement} from '@polymer/polymer/polymer-element.js'; | ||
import {html} from '@polymer/polymer/lib/utils/html-tag.js'; | ||
|
||
class TemplateInner extends PolymerElement { | ||
|
||
static get is() { return 'template-inner' } | ||
|
||
static get template() { | ||
return html` | ||
<div>Hello template inner</div> | ||
`; | ||
} | ||
} | ||
|
||
customElements.define(TemplateInner.is, TemplateInner); |
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,17 @@ | ||
import {PolymerElement} from '@polymer/polymer/polymer-element.js'; | ||
import {html} from '@polymer/polymer/lib/utils/html-tag.js'; | ||
import './template-inner.js'; | ||
|
||
class TemplateOuter extends PolymerElement { | ||
|
||
static get is() { return 'template-outer'; } | ||
|
||
static get template() { | ||
return html` | ||
<div>Hello template outer</div> | ||
<template-inner id="inner" style="display: block"></template-inner> | ||
`; | ||
} | ||
} | ||
|
||
customElements.define(TemplateOuter.is, TemplateOuter); |
62 changes: 62 additions & 0 deletions
62
...context/src/main/java/com/vaadin/flow/uitest/ui/template/InnerTemplateVisibilityView.java
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,62 @@ | ||
package com.vaadin.flow.uitest.ui.template; | ||
|
||
import com.vaadin.flow.component.Tag; | ||
import com.vaadin.flow.component.dependency.HtmlImport; | ||
import com.vaadin.flow.component.dependency.JsModule; | ||
import com.vaadin.flow.component.html.NativeButton; | ||
import com.vaadin.flow.component.polymertemplate.Id; | ||
import com.vaadin.flow.component.polymertemplate.PolymerTemplate; | ||
import com.vaadin.flow.router.Route; | ||
import com.vaadin.flow.templatemodel.TemplateModel; | ||
import com.vaadin.flow.uitest.servlet.ViewTestLayout; | ||
import com.vaadin.flow.uitest.ui.AbstractDivView; | ||
|
||
@Route(value = "com.vaadin.flow.uitest.ui.template.InnerTemplateVisibilityView", layout = ViewTestLayout.class) | ||
public class InnerTemplateVisibilityView extends AbstractDivView { | ||
|
||
public static final String TOGGLE_INNER_VISIBILITY_BUTTON_ID = "toggleInnerVisibility"; | ||
public static final String TOGGLE_OUTER_VISIBILITY_BUTTON_ID = "toggleOuterVisibility"; | ||
public static final String INNER_ID = "inner"; | ||
public static final String OUTER_ID = "outer"; | ||
|
||
@Tag("template-inner") | ||
@JsModule("./template-inner.js") | ||
@HtmlImport("frontend://com/vaadin/flow/uitest/ui/template/template-inner.html") | ||
public static class Inner extends PolymerTemplate<Inner.Model> { | ||
public static class Model implements TemplateModel {} | ||
|
||
public Inner() { | ||
} | ||
} | ||
|
||
@Tag("template-outer") | ||
@JsModule("./template-outer.js") | ||
@HtmlImport("frontend://com/vaadin/flow/uitest/ui/template/template-outer.html") | ||
public static class Outer extends PolymerTemplate<Outer.Model> { | ||
public static class Model implements TemplateModel {} | ||
|
||
@Id("inner") | ||
Inner inner; | ||
|
||
public Outer() { | ||
} | ||
} | ||
|
||
public InnerTemplateVisibilityView() { | ||
Outer outer = new Outer(); | ||
outer.setId(OUTER_ID); | ||
outer.inner.setId(INNER_ID); | ||
|
||
NativeButton toggleOuterVisibilityButton = new NativeButton( | ||
"Toggle visibility of outer", | ||
e -> outer.setVisible(!outer.isVisible())); | ||
toggleOuterVisibilityButton.setId(TOGGLE_OUTER_VISIBILITY_BUTTON_ID); | ||
|
||
NativeButton toggleInnerVisibility = new NativeButton( | ||
"Toggle visibility of inner", | ||
e -> outer.inner.setVisible(!outer.inner.isVisible())); | ||
toggleInnerVisibility.setId(TOGGLE_INNER_VISIBILITY_BUTTON_ID); | ||
|
||
add(toggleOuterVisibilityButton, toggleInnerVisibility, outer); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...t-context/src/main/webapp/frontend/com/vaadin/flow/uitest/ui/template/template-inner.html
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,15 @@ | ||
<link rel="import" href="/frontend/bower_components/polymer/polymer-element.html"> | ||
|
||
<dom-module id="template-inner"> | ||
<template> | ||
<div>Hello template inner</div> | ||
</template> | ||
|
||
<script> | ||
class TemplateInner extends Polymer.Element { | ||
static get is() { return 'template-inner' } | ||
} | ||
|
||
customElements.define(TemplateInner.is, TemplateInner); | ||
</script> | ||
</dom-module> |
16 changes: 16 additions & 0 deletions
16
...t-context/src/main/webapp/frontend/com/vaadin/flow/uitest/ui/template/template-outer.html
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,16 @@ | ||
<link rel="import" href="/frontend/bower_components/polymer/polymer-element.html"> | ||
|
||
<dom-module id="template-outer"> | ||
<template> | ||
<div>Hello template outer</div> | ||
<template-inner id="inner" style="display: block"></template-inner> | ||
</template> | ||
|
||
<script> | ||
class TemplateOuter extends Polymer.Element { | ||
static get is() { return 'template-outer'; } | ||
} | ||
|
||
customElements.define(TemplateOuter.is, TemplateOuter); | ||
</script> | ||
</dom-module> |
Oops, something went wrong.