Skip to content

Drag-Panning breaks when disabling PinchableScrollRect while dragging #1

Open

Description

@Noshire

Reproduction steps:

  • Set up a PinchableScrollRect in a window that you can show/hide (e.g. gameObject.SetActive()) at the press of a key (e.g. hide it with Esc)
  • show the window
  • start dragging around with your mouse to pan. Without releasing the mouse button, press Esc (or whichever key you designated to disabling the GameObject containing the PinchableScrollRect) to close the window
  • show the window again
  • dragging to pan doesn't work anymore.

The PinchableScrollRect will remain stuck in this state. If you hold down your mouse button and press Esc again, and then open it again, the first drag-pan will work - but after that it will stop working again.

I checked the code, and I think it has to do with the way that PinchableScrollRect.OnPinchStart and OnPinchEnd call base.OnEndDrag and base.OnBeginDrag respectively. This leads to states where, after releasing the mouse button, ScrollRect.m_Dragging remains true.

Thanks for this awesome component! Except for this behaviour, it works really well and feels great to interact with.

Activity

  1. LokoSoloGames commented on Oct 15, 2024

    @LokoSoloGames
    Owner

    Thank you for the report. Will take a look on this.

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions