FIX: Limit pan event handler to fix scrolling in TOC (#16673)

This commit is contained in:
Penar Musaraj 2022-05-09 09:04:03 -04:00 committed by GitHub
parent ab6ca78486
commit 54759b7e8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 4 deletions

View File

@ -168,14 +168,18 @@ export default Component.extend(PanEvents, {
},
panStart(e) {
if (e.originalEvent.target.classList.contains("docked")) {
const target = e.originalEvent.target;
if (
target.classList.contains("docked") ||
!target.closest(".timeline-container")
) {
return;
}
e.originalEvent.preventDefault();
const center = e.center;
const $centeredElement = $(document.elementFromPoint(center.x, center.y));
if ($centeredElement.parents(".timeline-scrollarea-wrapper").length) {
const centeredElement = document.elementFromPoint(e.center.x, e.center.y);
if (centeredElement.closest(".timeline-scrollarea-wrapper")) {
this.isPanning = false;
} else if (e.direction === "up" || e.direction === "down") {
this.isPanning = true;