Skip to content

Commit 649379f

Browse files
committed
fix: info box is getting triggered for phoenix internal elements
1 parent 300c297 commit 649379f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/LiveDevelopment/BrowserScripts/RemoteFunctions.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ function RemoteFunctions(config = {}) {
129129
if(element && // element should exist
130130
element.tagName.toLowerCase() !== "body" && // shouldn't be the body tag
131131
element.tagName.toLowerCase() !== "html" && // shouldn't be the HTML tag
132+
!element.closest("[data-phcode-internal-c15r5a9]") && // this attribute is used by phoenix internal elements
132133
!_isInsideHeadTag(element)) { // shouldn't be inside the head tag like meta tags and all
133134
return true;
134135
}
@@ -1461,6 +1462,7 @@ function RemoteFunctions(config = {}) {
14611462

14621463
_style: function() {
14631464
this.body = window.document.createElement("div");
1465+
this.body.setAttribute("data-phcode-internal-c15r5a9", "true");
14641466

14651467
// this is shadow DOM.
14661468
// we need it because if we add the box directly to the DOM then users style might override it.
@@ -1740,6 +1742,7 @@ function RemoteFunctions(config = {}) {
17401742

17411743
_style: function() {
17421744
this.body = window.document.createElement("div");
1745+
this.body.setAttribute("data-phcode-internal-c15r5a9", "true");
17431746

17441747
// this is shadow DOM.
17451748
// we need it because if we add the box directly to the DOM then users style might override it.
@@ -1924,6 +1927,7 @@ function RemoteFunctions(config = {}) {
19241927

19251928
_style: function() {
19261929
this.body = window.document.createElement("div");
1930+
this.body.setAttribute("data-phcode-internal-c15r5a9", "true");
19271931
// using shadow dom so that user styles doesn't override it
19281932
const shadow = this.body.attachShadow({ mode: "open" });
19291933

@@ -2293,7 +2297,8 @@ function RemoteFunctions(config = {}) {
22932297
ImageRibbonGallery.prototype = {
22942298
_style: function () {
22952299
this.body = window.document.createElement("div");
2296-
this._shadow = this.body.attachShadow({mode: 'closed'});
2300+
this.body.setAttribute("data-phcode-internal-c15r5a9", "true");
2301+
this._shadow = this.body.attachShadow({ mode: 'open' });
22972302

22982303
this._shadow.innerHTML = `
22992304
<style>
@@ -4556,6 +4561,7 @@ function RemoteFunctions(config = {}) {
45564561
// create a new fresh toast container
45574562
const toast = window.document.createElement('div');
45584563
toast.id = 'phoenix-toast-notification';
4564+
toast.setAttribute("data-phcode-internal-c15r5a9", "true");
45594565
const shadow = toast.attachShadow({ mode: 'open' });
45604566

45614567
const styles = `

0 commit comments

Comments
 (0)