Skip to content

Goto with replaceState on safari disturb animation #15374

@piolet

Description

@piolet

Describe the bug

Hello everyone,

It's difficult to explain this problem, but I only have it on Safari and it greatly disrupts the user experience.

I'll try to give a little context.
When I click on a button on my page, I want to change the hash of my URL.
To do this, I use the goto function with the replaceState parameter set to true.
At the same time as I click on this button, a toast may appear to notify me of some information.

I don't encounter any problems on other browsers, but on Safari (iOS or macOS, apparently), when I do this, there is a kind of flickering on the toast and anything else on the page that may be subject to animation.

If I comment my line :

goto(`${currentUrl}#${newHash}`, { replaceState: true, noScroll: true, keepFocus: true })

then, I don't have any animation issues.

Has anyone else encountered this kind of problem or have any ideas on how to fix it?

Reproduction

In my case, animate a div (toast) during replace url's hash on safari

Logs

System Info

System:
    OS: macOS 15.7.4
    CPU: (12) x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
    Memory: 513.39 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.18.0 - /usr/local/bin/node
    npm: 11.2.0 - /Users/user_home/Library/pnpm/npm
    pnpm: 10.30.0 - /Users/user_home/Library/pnpm/pnpm
    Watchman: 2025.04.28.00 - /usr/local/bin/watchman
  Browsers:
    Brave Browser: 91.1.26.77
    Chrome: 145.0.7632.76
    Edge: 145.0.3800.58
    Firefox: 147.0.4
    Safari: 26.2

Severity

annoyance

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions