forked from xziino/ff14-mitigator
Planer: Gantt-Klick zum Hinzufügen repariert (Pointer-Capture-Bug)
setPointerCapture() leitet Compatibility Mouse Events (inkl. click) an das capturing Element um – e.target im click-Handler war immer .timeline-scroll, nie das angeklickte .timeline-track. Fix: document.elementFromPoint() für zuverlässigen Hit-Test unabhängig von Pointer Capture. Pan-Threshold zusätzlich von 3px auf 8px erhöht. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
fd0de86dbc
commit
c983ca6621
@ -1242,7 +1242,7 @@ function initTimeline(planId) {
|
|||||||
timeline.addEventListener('pointermove', e => {
|
timeline.addEventListener('pointermove', e => {
|
||||||
if (!timelinePan || timelinePan.pointerId !== e.pointerId) return;
|
if (!timelinePan || timelinePan.pointerId !== e.pointerId) return;
|
||||||
const dx = e.clientX - timelinePan.startX;
|
const dx = e.clientX - timelinePan.startX;
|
||||||
if (Math.abs(dx) > 3) {
|
if (Math.abs(dx) > 8) {
|
||||||
timelinePan.moved = true;
|
timelinePan.moved = true;
|
||||||
timelinePan.scroll.classList.add('timeline-scroll--dragging');
|
timelinePan.scroll.classList.add('timeline-scroll--dragging');
|
||||||
timelinePan.scroll.scrollLeft = timelinePan.startScrollLeft - dx;
|
timelinePan.scroll.scrollLeft = timelinePan.startScrollLeft - dx;
|
||||||
@ -1307,8 +1307,11 @@ function initTimeline(planId) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const track = e.target.closest('.timeline-player-row .timeline-track');
|
// setPointerCapture() leitet compatibility mouse events (inkl. click) an das
|
||||||
const row = e.target.closest('.timeline-player-row');
|
// capturing element um, daher e.target nicht verlässlich — echtes Element per Hit-Test:
|
||||||
|
const actualTarget = document.elementFromPoint(e.clientX, e.clientY);
|
||||||
|
const track = actualTarget?.closest('.timeline-player-row .timeline-track');
|
||||||
|
const row = actualTarget?.closest('.timeline-player-row');
|
||||||
if (!track || !row) return;
|
if (!track || !row) return;
|
||||||
const plan = getPlan(planId);
|
const plan = getPlan(planId);
|
||||||
if (!plan) return;
|
if (!plan) return;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user