-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
ui: Alter position of logic for showing the Round Trip Time tab to prevent DOM refresh #7377
Conversation
Previously we checked the length of tomography.distances to decide whether to show the RTT tab or not. Previous to our ember upgrade this would not cause a DOM reload of so many elements (i.e. all of the tab content). Since our ember upgrade, any change to tomography (so not necessarily the length of distances) seems to fire a change to the length (even if the length remains the same). The knock on effect of this is that the array of tab panels seems to be recalculated (but remain the same) and all of the tab panels are completely re-rendered, causing the scroll of the page to be reset. This commit moves the check for tomography.distance.length to the lower down to the partial, which means the array of tab panels always remains the same, which consequently means that the entire array of tab panels is never re-rendered entirely, and therefore fixes the issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
♻️ LGTM
Sorry @kaxcode , I had a re-think about this and decided to put the logic in the same template it originally was (which is also the same place we have the logic for showing the tab or not). The other benefit is, my previous attempt would still show the |
…event DOM refresh (#7377) * ui: Move tomography length check inside of the partial Previously we checked the length of tomography.distances to decide whether to show the RTT tab or not. Previous to our ember upgrade this would not cause a DOM reload of so many elements (i.e. all of the tab content). Since our ember upgrade, any change to tomography (so not necessarily the length of distances) seems to fire a change to the length (even if the length remains the same). The knock on effect of this is that the array of tab panels seems to be recalculated (but remain the same) and all of the tab panels are completely re-rendered, causing the scroll of the page to be reset. This commit moves the check for tomography.distance.length to the lower down with the loop, which means the array of tab panels always remains the same, which consequently means that the entire array of tab panels is never re-rendered entirely, and therefore fixes the issue.
…event DOM refresh (hashicorp#7377) * ui: Move tomography length check inside of the partial Previously we checked the length of tomography.distances to decide whether to show the RTT tab or not. Previous to our ember upgrade this would not cause a DOM reload of so many elements (i.e. all of the tab content). Since our ember upgrade, any change to tomography (so not necessarily the length of distances) seems to fire a change to the length (even if the length remains the same). The knock on effect of this is that the array of tab panels seems to be recalculated (but remain the same) and all of the tab panels are completely re-rendered, causing the scroll of the page to be reset. This commit moves the check for tomography.distance.length to the lower down with the loop, which means the array of tab panels always remains the same, which consequently means that the entire array of tab panels is never re-rendered entirely, and therefore fixes the issue.
Previously we checked the length of tomography.distances to decide
whether to show the RTT tab or not. Previous to our ember upgrade this
would not cause a DOM reload of so many elements (i.e. all of the tab
content). Since our ember upgrade, any change to tomography (so not
necessarily the length of distances) seems to fire a change to the length (even if
the length remains the same). The knock on effect of this is that the
array of tab panels seems to be recalculated (but remain the same) and
all of the tab panels are completely re-rendered, causing the scroll of
the page to be reset.
This commit moves the check for tomography.distance.length to the lower
down to the partial, which means the array of tab panels always remains
the same, which consequently means that the entire array of tab panels
is never re-rendered entirely, and therefore fixes the issue.
Fixes #7365
There is also another bug we found on our travels here, I decided to separate both PRs out, so theres another related one to follow.