in our current custom dialog component we implement the Polymer.PaperDialogBehavior but the paper-dialog-scrollable wasn't able to locate the behavior, only in the host property
ready: function () {
this.$$('paper-dialog-scrollable').dialogElement = this;
}
the problem is in this function:
_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.
if (this.dialogElement && this.dialogElement.behaviors &&
this.dialogElement.behaviors.indexOf(Polymer.PaperDialogBehaviorImpl) >= 0) {
this.dialogElement.sizingTarget = this.scrollTarget;
this.scrollTarget.classList.remove('fit');
} else if (this.dialogElement) {
this.scrollTarget.classList.add('fit');
}
}
if you consol.log the this.dialogElement you will see the #shadow-root element, and this element does not has the behaviors, but if you try to look up them in the this.dialogElement.host - they are there... I believe this is most clear solution, instead of checking for root.
in our current custom dialog component we implement the
Polymer.PaperDialogBehavior
but the paper-dialog-scrollable wasn't able to locate the behavior, only in the host propertyour current implementation:
the JS code
the problem is in this function:
if you consol.log the
this.dialogElement
you will see the #shadow-root element, and this element does not has the behaviors, but if you try to look up them in the this.dialogElement.host - they are there... I believe this is most clear solution, instead of checking for root.