Fix animation bug in safari
When showing the sidebar, Safari was causing the sidebar to snap into place without animating. This is apparently some well-known issue where it doesn't like adding new elements (or changing display) and toggling an animated transition in the same event loop.
This commit is contained in:
parent
16b99be17f
commit
d1c09791ab
1 changed files with 4 additions and 0 deletions
|
|
@ -540,6 +540,10 @@ aria-label="Show hidden lines"></button>';
|
|||
/* To allow the sidebar expansion animation, we first need to put back the display. */
|
||||
if (!sidebarCheckbox.checked) {
|
||||
sidebar.style.display = '';
|
||||
// Workaround for Safari skipping the animation when changing
|
||||
// `display` and a transform in the same event loop. This forces a
|
||||
// reflow after updating the display.
|
||||
sidebar.offsetHeight;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue