Skip to content

Pan Functionality Fails to Activate When Initially Disabled #921

Open
@tesar-tech

Description

@tesar-tech

When you start the chart with the pan functionality disabled and later enable it, the pan won't work. All the samples start with pan enabled, which is why it works in those cases.

In the next part, I will reproduce the issue in the simplest way by disabling pan functionality from the start.

Steps to Reproduce

(Apologies for the awkward setup—this was just the easiest way for me to test it)

  1. Go to the samples page: https://www.chartjs.org/chartjs-plugin-zoom/samples/basic.html.
  2. Open the F12 developer tools and locate the chunk file 17.49536e53.js, which runs the basic example.
  3. Navigate to line 24, where the sample code is defined, and change the following piece starting at column 1435:
    pan: {\n    enabled: true,
    to
    pan: {\n    enabled: false,
  4. Override the file to ensure the change survives a refresh.
  5. Refresh the page. Pan functionality is now disabled, but when you toggle it, it won't activate.
aa80856d-407b-448d-87f8-51ae3b9b4792.mp4

Expected Behavior

The pan functionality should activate when toggled after being initially disabled.

Additional Notes

My guess is that this issue might be related to how mouse events are registered.

Also, note that this behavior doesn't occur for other options, like zoom.wheel; it only happens with the pan functionality.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions