Skip to content

The Detail slider cannot be moved with the pointer #564

Description

@JArmandoAnaya

The Detail slider on the suggestion card cannot be moved with the pointer. Pressing it does
nothing, dragging the thumb does nothing, and clicking along the track does nothing. The only
way to change the setting is [ and ].

Reproduce

  1. Arm the suggest tool and click an object on a polygon class.
  2. Open Adjust the shape.
  3. Try to drag the Detail thumb, or click somewhere along its track.

Nothing moves. The brackets still work, so the setting itself is fine — it is the control that
is dead.

Mechanism

The press is cancelled. The slider carried a mousedown handler calling preventDefault(),
added so that pressing a control on the card would not take keyboard focus away from the
canvas — every chord in the editor is a keydown on the annotator's own root, so a control
holding focus switches [, ], Esc and Enter off with nothing on screen to say why.

That guard is right for a button and wrong for a range input, because a range input drags on
its default action
. Cancelling the press cancels the drag.

Why no test caught it

The test asserted that the guard fired — that preventDefault had been called on the press.
That is the one assertion a control which does nothing at all will always pass. Nothing
anywhere dragged the thumb and looked at the value, and jsdom could not have: a range input's
default action does not exist there.

The shape of the fix

Both halves have to hold at once: the drag has to work, and the canvas has to get its keyboard
back. Focus can move to the slider for the duration of a gesture and return on release — the
frame gallery already returns focus to the canvas by the same route after its overlay closes.

The test that goes with it is a real pointer drag in chromium: press, travel, release, then
assert the value moved, the shape re-simplified, and a bracket still reaches the canvas
afterwards. fill() and click() both set a range input's value without exercising the
default action, so neither would have caught this either.

cf. #557, which introduced the slider.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfrontendannotator / ui-core / app packages

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions