Skip to content

Schedule/fix bar drag trailing click - #2183

Open
Chantology wants to merge 2 commits into
cgwire:mainfrom
Chantology:schedule/fix-bar-drag-trailing-click
Open

Schedule/fix bar drag trailing click#2183
Chantology wants to merge 2 commits into
cgwire:mainfrom
Chantology:schedule/fix-bar-drag-trailing-click

Conversation

@Chantology

Copy link
Copy Markdown
Contributor

Problem

Dragging a schedule bar (department/task-type row, entity row, or a person's task) always fired a trailing click on top of the drag itself, because a native click still fires on mouseup whenever mousedown and mouseup land on the same element, regardless of pointer movement in between.
For a task-type row (e.g. Asset/Rigging), that trailing click re-triggered root-element-selected, which expands the row — so moving the bar unfolded it every time.
The same pattern also re-fired item-selected on entity rows and task-selected on a person's task bars.

Solution

stopBrowsing now flags when it detects real pointer movement during a drag.
New onRootBarClick / onChildBarClick / onTaskBarClick handlers consume that flag once and skip the select/expand event for the trailing click only; a genuine no-movement click still works as before.
Added a test that drives a real mousedown → mousemove → mouseup → click sequence and is confirmed to fail before the fix, pass after.

Comment
I am not 100% sure if this patch is against anything that is intended. It felt a bit annoying when the tasks always collapse as soon as I move a task schedule and reveal everything below. Sometimes you just want to move timelines and not always look on whats underneath. There is a pop up message in case you are changing anything drastically that would affect start dates and end dates below. Then you can collapse the tasks yourself.

A native click still fires on mouseup whenever mousedown and mouseup land
on the same element, drag or not, so finishing a move on a schedule bar
always re-fired root-element-selected / item-selected / task-selected on
top of the drag itself. For a task-type row that re-triggered the same
handler used to expand it, unfolding the row on every move.
Three comments explained the same click-after-drag mechanism; kept it
in one place and trimmed the others to what's non-obvious at each spot.
@Chantology
Chantology marked this pull request as ready for review August 19, 2026 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant