From 002f84fe19c88841bf109b6c4fae0b855c603a5c Mon Sep 17 00:00:00 2001 From: Valdrin Koshi Date: Tue, 30 May 2017 14:47:01 -0700 Subject: [PATCH] Check parentElement to skip shadowRoots (#69) --- paper-dialog-scrollable.html | 7 +++---- test/paper-dialog-scrollable.html | 27 +++++++++++++++++++++++++++ test/test-dialog.html | 25 +++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 4 deletions(-) create mode 100644 test/test-dialog.html diff --git a/paper-dialog-scrollable.html b/paper-dialog-scrollable.html index c27c69e..dd40648 100644 --- a/paper-dialog-scrollable.html +++ b/paper-dialog-scrollable.html @@ -161,10 +161,9 @@

Sub-header

}, _ensureTarget: function () { - // read parentNode on attached because if dynamically created, - // parentNode will be null on creation. - this.dialogElement = this.dialogElement || Polymer.dom(this).parentNode; - // Check if parent implements paper-dialog-behavior. If not, fit scrollTarget to host. + // Read parentElement instead of parentNode in order to skip shadowRoots. + this.dialogElement = this.dialogElement || this.parentElement; + // Check if dialog implements paper-dialog-behavior. If not, fit scrollTarget to host. if (this.dialogElement && this.dialogElement.behaviors && this.dialogElement.behaviors.indexOf(Polymer.PaperDialogBehaviorImpl) >= 0) { this.dialogElement.sizingTarget = this.scrollTarget; diff --git a/test/paper-dialog-scrollable.html b/test/paper-dialog-scrollable.html index 2397bdb..6ee82cb 100644 --- a/test/paper-dialog-scrollable.html +++ b/test/paper-dialog-scrollable.html @@ -23,6 +23,7 @@ +