Skip to content

Move reconnection delay mechanism into framework code #24566

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

Merged
merged 2 commits into from
Aug 5, 2020

Conversation

SteveSandersonMS
Copy link
Member

In #24137, a delay was added before showing the reconnection dialog. At first this was implemented in JS, but I suggested moving the implementation into CSS so that we didn't have to worry about cases like "reconnection occurred during delay". This is great but has the drawback of complicating the site.css file in the project template.

I've since realised that a third and better option exists, which is a hybrid: implementing the delay in CSS (via transition), but triggering it from JS. This retains the benefit of not risking inconsistency depending on the timing of reconnection, plus the benefit that it removes the extra code from the app developer's own CSS file.

This PR makes that tweak, leaving the default delay at 500ms. Developers who want to override the delay can still easily do so using CSS. For example, to change it to 2 seconds:

#components-reconnect-modal {
    transition-delay: 2s !important;
}

@SteveSandersonMS SteveSandersonMS added the area-blazor Includes: Blazor, Razor Components label Aug 4, 2020
@SteveSandersonMS SteveSandersonMS requested a review from a team August 4, 2020 17:35
Copy link
Member

@captainsafia captainsafia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice change! I believe the JS test cases for the reconnection display will need to be updated as part of this.

@SteveSandersonMS
Copy link
Member Author

I believe the JS test cases for the reconnection display will need to be updated as part of this.

Great point! Done.

@SteveSandersonMS SteveSandersonMS merged commit d99644e into master Aug 5, 2020
@SteveSandersonMS SteveSandersonMS deleted the stevesa/reconnection-delay branch August 5, 2020 15:00
@captainsafia
Copy link
Member

@SteveSandersonMS Heads up that I'll be cherry-picking this into our servicing PR for the disconnect bug fix.

wtgodbe pushed a commit that referenced this pull request Aug 13, 2020
* Disconnect circuit on `beforeunload` event (#23224)

* Add delay before showing Reconnection UI (#24137)

* Add CSS delay before showing Reconnection UI

* rebuild yet again to try and get past the conflict

* Move reconnection delay mechanism into framework code (#24566)

Co-authored-by: SQL-MisterMagoo <[email protected]>
Co-authored-by: Steve Sanderson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants