Skip to content

Commit

Permalink
fix: Make sure to redirect after adding a feed
Browse files Browse the repository at this point in the history
  • Loading branch information
marienfressinaud committed Jul 26, 2023
1 parent 9c4517c commit 3ff109d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ function adaptLayoutContentBorderRadius () {

document.addEventListener('turbo:load', adaptLayoutContentBorderRadius);

// Make sure to visit the response when receiving the `turbo:frame-missing` event.
// This happens most of the time on redirection after submitting a form in a modal.
// Otherwise, "Content missing" would be displayed within the modal.
document.addEventListener('turbo:frame-missing', (event) => {
event.preventDefault();
event.detail.visit(event.detail.response);
});

// Allow to disable scroll on form submission.
// Submitting forms with a `data-turbo-preserve-scroll` attribute will keep the
// scroll position at the current position.
Expand Down

0 comments on commit 3ff109d

Please sign in to comment.