fix: wheel zooming in timeline tracks content
This commit is contained in:
@ -482,7 +482,8 @@ export function Timeline() {
|
|||||||
// Prevent explorer zooming in/out when in timeline
|
// Prevent explorer zooming in/out when in timeline
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const preventZoom = (e: WheelEvent) => {
|
const preventZoom = (e: WheelEvent) => {
|
||||||
if (isInTimeline && (e.ctrlKey || e.metaKey)) {
|
// if (isInTimeline && (e.ctrlKey || e.metaKey)) {
|
||||||
|
if (isInTimeline && (e.ctrlKey || e.metaKey) && timelineRef.current?.contains(e.target as Node)) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -825,7 +826,6 @@ export function Timeline() {
|
|||||||
}}
|
}}
|
||||||
onClick={handleTimelineAreaClick}
|
onClick={handleTimelineAreaClick}
|
||||||
onMouseDown={handleTimelineMouseDown}
|
onMouseDown={handleTimelineMouseDown}
|
||||||
onWheel={handleWheel}
|
|
||||||
>
|
>
|
||||||
{tracks.length === 0 ? (
|
{tracks.length === 0 ? (
|
||||||
<div className="absolute inset-0 flex items-center justify-center">
|
<div className="absolute inset-0 flex items-center justify-center">
|
||||||
|
Reference in New Issue
Block a user