Skip to content

resetzoom triggering after drag (beta) #441

@pgp80

Description

@pgp80

I'm trying out the betas of both chartjs and zoom, and I'm noticing some behavior which is different from the current versions I have on a project. I have drag zoom enabled and in the current version, it zooms and then I have onClick: resetZoom and it reverts to original form. In the beta, I drag and as soon as I release the mouse the resetZoom occurs immediately (so it doesn't stay zoomed in). Removing the onClick in the beta does result in a stable zooming. Just thought I'd share!
``
options: {

scales: {
  x: {
  	type: 'time',
      unit: 'hour'
  },//end x
  y: {
    
  }//end y
},//end scales
 
plugins: {
  zoom: {
    
    zoom: {
      enabled: true,
      drag: true,
      mode: 'x',
    
    }
  }
},
onClick: resetZoom,

}//end options

recording (1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions