feat: handle rails turbo morphing (#11422)

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
This commit is contained in:
Shivam Mishra
2025-05-07 10:22:08 +05:30
committed by GitHub
parent c8daa6c1fe
commit ea3ef9064b
4 changed files with 15 additions and 6 deletions

View File

@@ -5,6 +5,7 @@ export const loadCSS = () => {
const css = document.createElement('style');
css.innerHTML = `${SDK_CSS}`;
css.id = 'cw-widget-styles';
css.dataset.turboPermanent = true;
document.body.appendChild(css);
};

View File

@@ -82,6 +82,7 @@ export const IFrameHelper = {
addClasses(widgetHolder, holderClassName);
widgetHolder.id = 'cw-widget-holder';
widgetHolder.dataset.turboPermanent = true;
widgetHolder.appendChild(iframe);
body.appendChild(widgetHolder);
IFrameHelper.initPostMessageCommunication();

View File

@@ -67,6 +67,7 @@ export const createBubbleHolder = hideMessageBubble => {
}
addClasses(bubbleHolder, 'woot--bubble-holder');
bubbleHolder.id = 'cw-bubble-holder';
bubbleHolder.dataset.turboPermanent = true;
body.appendChild(bubbleHolder);
};