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
Flashing element on phx-connected
/ phx-disconnected
#2276
Comments
To be clear just so I understand the problem correctly, the containers are not shown on initial page load correct? Only on refresh or navigate away? Thanks! |
No, it also shows during the initial page load: Screen.Recording.2022-10-12.at.15.49.46.mov |
To me it only happens on leave. For instance if the page displays a link to an external page and I click on it. On page load the behaviour is as expected. |
Not sure if related or helpful, but this occurs for me when I remove the |
@rgraff this save me a lot of time - I must have removed the |
Environment
Actual behavior
Currently the
phx-disconnected
binding is executed on every page load before the LiveSocket is connected.This means if a message is displayed (like in the example) the message flashes on every page reload.
I think it would be nice to delay the
phx-disconnected
binding on initial page load.The same problem exists when changing the page from a live view to a dead view where the message flashes for a moment before the page changes.
Here are two examples:
Reloading (fresh Phoenix 1.16.4 project with the code snippet from the hex docs example):
Screen.Recording.2022-10-12.at.14.49.37.mov
Page changing (project generated from the current phoenix master branch and
phx.gen.auth --live
generated pages) :Screen.Recording.2022-10-12.at.15.18.18.mov
The text was updated successfully, but these errors were encountered: