From 9b0c1acf9445a90249afd429dd8931ef6899631c Mon Sep 17 00:00:00 2001 From: Shadi Khani <43351116+shadikhani@users.noreply.github.com> Date: Wed, 8 Jan 2020 08:14:10 -0800 Subject: [PATCH] fix: flush to make textContent work with ShadyDOM (#138) --- src/vaadin-button.html | 3 +++ test/button-in-template.html | 38 ++++++++++++++++++++++++++++++++++++ test/test-suites.js | 3 ++- 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 test/button-in-template.html diff --git a/src/vaadin-button.html b/src/vaadin-button.html index da3dd35..ef1e86c 100644 --- a/src/vaadin-button.html +++ b/src/vaadin-button.html @@ -147,6 +147,9 @@ this.$.button.setAttribute('role', 'presentation'); this._addActiveListeners(); + + // Fix for https://github.com/vaadin/vaadin-button-flow/issues/120 + window.ShadyDOM && window.ShadyDOM.flush(); } /** diff --git a/test/button-in-template.html b/test/button-in-template.html new file mode 100644 index 0000000..97bcb92 --- /dev/null +++ b/test/button-in-template.html @@ -0,0 +1,38 @@ + +
+ +