Skip to content

Commit

Permalink
exclude OP custom dom elements from being morphed
Browse files Browse the repository at this point in the history
  • Loading branch information
ulferts authored and dombesz committed Dec 17, 2024
1 parent 1eb9eac commit 4bd144d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions frontend/src/turbo/turbo-global-listeners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,13 @@ export function addTurboGlobalListeners() {
activateFlashNotice();
activateFlashError();
});

document.addEventListener('turbo:before-morph-element', (event) => {
const element = event.target as HTMLElement;

// In case the element is an OpenProject custom dom element, morphing is prevented.
if (element.tagName.startsWith('OPCE-')) {
event.preventDefault();
}
});
}

0 comments on commit 4bd144d

Please sign in to comment.