Media Viewer: Fix scrolling caption (#1916)

This commit is contained in:
Alexander Zinchuk 2022-06-27 22:02:47 +02:00
parent cf2fdc7219
commit 53e87868fa

View File

@ -321,6 +321,12 @@ export function captureEvents(element: HTMLElement, options: CaptureOptions) {
function onWheel(e: WheelEvent) {
if (!options.onZoom && !options.onDrag) return;
if (options.excludedClosestSelector && (
(e.target as HTMLElement).matches(options.excludedClosestSelector)
|| (e.target as HTMLElement).closest(options.excludedClosestSelector)
)) {
return;
}
e.preventDefault();
e.stopPropagation();
if (!hasMoved) {