mirror of
https://github.com/suitenumerique/docs
synced 2026-04-21 13:37:20 +00:00
🐛(frontend) fix flickering left panel
In some cases, the left panel can flicker when navigating from the index to a document page. This is due to different state + a transition effect. To fix this, we remove the transition effect when mounting.
This commit is contained in:
parent
a2ae41296d
commit
a9d2517c7b
2 changed files with 21 additions and 3 deletions
|
|
@ -22,6 +22,7 @@ and this project adheres to
|
|||
|
||||
- 🐛(backend) create a link_trace record for on-boarding documents
|
||||
- 🐛(backend) manage race condition when creating sandbox document
|
||||
- 🐛(frontend) fix flickering left panel #1989
|
||||
- ♿️(frontend) improve doc tree keyboard navigation #1981
|
||||
|
||||
## [v4.7.0] - 2026-03-09
|
||||
|
|
|
|||
|
|
@ -45,6 +45,22 @@ export const ResizableLeftPanel = ({
|
|||
);
|
||||
});
|
||||
|
||||
const [isMounting, setIsMounting] = useState(false);
|
||||
|
||||
/**
|
||||
* To avoid flickering animation on initial load
|
||||
*/
|
||||
useEffect(() => {
|
||||
const timeout = setTimeout(() => {
|
||||
setIsMounting(true);
|
||||
}, 500);
|
||||
|
||||
return () => {
|
||||
clearTimeout(timeout);
|
||||
setIsMounting(false);
|
||||
};
|
||||
}, []);
|
||||
|
||||
/**
|
||||
* When the panel is toggled open/closed, we want
|
||||
* to either expand/collapse
|
||||
|
|
@ -94,9 +110,10 @@ export const ResizableLeftPanel = ({
|
|||
collapsible={!isPanelOpen}
|
||||
collapsedSize={0}
|
||||
style={{
|
||||
transition: isDragging
|
||||
? 'none'
|
||||
: 'flex var(--c--globals--transitions--duration) var(--c--globals--transitions--ease-out)',
|
||||
transition:
|
||||
isDragging || !isMounting
|
||||
? 'none'
|
||||
: 'flex var(--c--globals--transitions--duration) var(--c--globals--transitions--ease-out)',
|
||||
}}
|
||||
order={0}
|
||||
defaultSize={
|
||||
|
|
|
|||
Loading…
Reference in a new issue