Experiment: unhide header when clicking on timeline items

This commit is contained in:
Lim Chee Aun 2024-07-03 20:01:11 +08:00
parent 95bf9e183e
commit c950a6552c

View file

@ -388,6 +388,17 @@ function Timeline({
dotRef.current = node;
}}
tabIndex="-1"
onClick={(e) => {
// If click on timeline item, unhide header
if (
headerRef.current &&
e.target.closest('.timeline-item, .timeline-item-alt')
) {
setTimeout(() => {
headerRef.current.hidden = false;
}, 250);
}
}}
>
<div class="timeline-deck deck">
<header