diff --git a/src/back/jdd-components/payment-details/payment-details.css b/src/back/jdd-components/payment-details/payment-details.css index d8afbf1..377d8b7 100644 --- a/src/back/jdd-components/payment-details/payment-details.css +++ b/src/back/jdd-components/payment-details/payment-details.css @@ -42,6 +42,7 @@ background: none; border: none; cursor: pointer; + svg { height: 16px; width: 16px; diff --git a/src/front/index.ts b/src/front/index.ts index 16ce00b..020b080 100644 --- a/src/front/index.ts +++ b/src/front/index.ts @@ -31,3 +31,33 @@ export * from "./controllers.js"; shouldPreserveScroll = false; }); })(); + +/* fix for https://github.com/hotwired/turbo/issues/1255 */ +(() => { + const markHashLinks = (root: ParentNode): void => { + root.querySelectorAll('a[href^="#"]').forEach((link) => { + link.dataset.turbo = "false"; + }); + }; + + markHashLinks(document); + + const observer = new MutationObserver((mutations) => { + mutations.forEach((mutation) => { + mutation.addedNodes.forEach((node) => { + if (!(node instanceof Element)) return; + + if (node instanceof HTMLAnchorElement && node.matches('a[href^="#"]')) { + node.dataset.turbo = "false"; + } + + markHashLinks(node); + }); + }); + }); + + observer.observe(document.documentElement, { + childList: true, + subtree: true, + }); +})();