Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navigation animations shown for replace actions #61

Open
leonvogt opened this issue Oct 9, 2024 · 0 comments
Open

Navigation animations shown for replace actions #61

leonvogt opened this issue Oct 9, 2024 · 0 comments

Comments

@leonvogt
Copy link

leonvogt commented Oct 9, 2024

In the PR #13 some nice looking default animations were added.
In the description it was mentioned that replace visits will not be animated. Which makes absolute sense.

This works as expected when the replace action is triggered directly through a Turbo visit, such as using Turbo.visit("/", { action: "replace" }) or via <a href="/" data-turbo-action="replace"></a>.
However, when the 'replace' action is configured through a path rule in the configuration, the animation is shown even though it shouldn't be.

Steps to reproduce (using the demo app)

  1. Remove the attribute data-turbo-action="replace" in the hotwire-native-demo one.ejs file:
- <p><a href="/two?action=replace" class="button@native" data-turbo-action="replace">Replace with another webpage</a></p>
+ <p><a href="/two?action=replace" class="button@native">Replace with another webpage</a></p>
  1. Add a path configuration rule in the Demo configuration.json file:
{
  "patterns": ["/two.*\\?.*action=replace"],
  "properties": {
    "uri": "hotwire://fragment/web",
    "presentation": "replace"
  }
},

Result: The replace is working. Page "one" is replaced with the page "two", but the animation is shown while doing so.

demo.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant