Skip to content

A cancelled drag leaves the end-stop slider editing, so it shows a stale stop and keeps hover controls open #695

Closed

Description

@Jonathanm10

What happens

When SwiftUI cancels a drag on a slider with an end stop (such as "endStop": {"value": 0, "label": "∞"}) instead of ending it, the slider stays in its editing state:

  • It ignores outside changes to its value, such as Undo or a configuration reload, and keeps showing the stop it was dragged to.
  • It keeps reporting that it is being edited, so hover controls that contain it stay expanded after the pointer leaves.

Steps to reproduce

  1. Give a widget a hoverLayout slider with an endStop.
  2. Start dragging the slider, then have SwiftUI cancel the drag before the mouse button is released, for example by disabling the slider mid-drag. In a running bar with inline hover controls, switching apps, right-clicking, pressing Escape or reloading the configuration mid-drag did not cancel the drag, so the user actions that reach this path are not pinned down yet.
  3. Change the slider's source value from outside, or move the pointer away from the widget.

Expected

A cancelled drag sends nothing, the knob goes back to the source's value, and the hover controls can collapse, as a filled slider already does.

Environment

  • StableBar: main at 6c3c16b
  • macOS 27.2.1 (26B131)

Evidence

A hosted-view test that drives the real DragGesture with mouse events, then disables the slider mid-drag, shows that the editing preference stays true after the cancel. A completed drag commits its value as expected.

Diagnosis

Sources/StableBar/EndStopSlider.swift resets editing only in finish(), which the drag gesture's onEnded calls. SwiftUI skips onEnded when it cancels a gesture, so editing stays true. Then:

  • .onChange(of: value) { if !editing { dragged = nil } } never clears the dragged stop.
  • .preference(key: ControlEditingPreference.self, value: editing) keeps publishing true, which HoverLayoutView reads to stay expanded.

Sources/StableBar/FilledSlider.swift already handles this: a @GestureState dragging resets however the drag ends, and .onChange(of: dragging) drops a drag that ended without onEnded.

Related

Triaged by Claude Code (claude-opus-5-5).

Activity

  1. added
    needs-triage
    on Nov 16, 2026
  2. stablebar-releases commented on Nov 16, 2026

    @stablebar-releases

    🎉 This issue has been resolved in version 0.17.0 🎉

    The release is available on GitHub release

    Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triagereleased

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions