Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Right click triggers event selection #1019

Closed
pawelfus opened this issue Jun 5, 2012 · 3 comments
Closed

Right click triggers event selection #1019

pawelfus opened this issue Jun 5, 2012 · 3 comments
Labels

Comments

@pawelfus
Copy link
Contributor

@pawelfus pawelfus commented Jun 5, 2012

From samples: http://jsfiddle.net/gh/get/jquery/1.7.1/highslide-software/highcharts.com/tree/master/samples/highcharts/chart/zoomtype-x/
Using right click to context menu we can zoom in chart, which isn't expected.

@TorsteinHonsi
Copy link
Collaborator

@TorsteinHonsi TorsteinHonsi commented Jun 5, 2013

Workaround

Add the following code snippet that overrides the Pointer object and stops right clicks from triggering Highcharts events:

(function (H) {
    function proceedWithLeftClickOnly (proceed, e) {
        if (e.button != 2) {     
            proceed.call(this, e);
        }
    }
    H.wrap(H.Pointer.prototype, 'onContainerMouseDown', proceedWithLeftClickOnly);
    H.wrap(H.Pointer.prototype, 'onDocumentMouseUp', proceedWithLeftClickOnly);
}(Highcharts));

Live demo: http://jsfiddle.net/highcharts/DE9B8/

@vadimpopa
Copy link

@vadimpopa vadimpopa commented Nov 22, 2017

Just wondering how come this hasn't been fixed up to now, we have the same issue on 5.x and the Fiddle runs on latest and still has the issue ?

@KacperMadej
Copy link
Contributor

@KacperMadej KacperMadej commented Nov 28, 2017

@TorsteinHonsi Are there any known limitations preventing the workaround to be included by default in core? or to make it settable from options in case of backwards compatibility issues?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants