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

Comments

Projects
None yet
4 participants
@pawelfus
Contributor

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

This comment has been minimized.

Show comment
Hide comment
@TorsteinHonsi

TorsteinHonsi Jun 5, 2013

Collaborator

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/

Collaborator

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

This comment has been minimized.

Show comment
Hide comment
@vadimpopa

vadimpopa 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 ?

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

This comment has been minimized.

Show comment
Hide comment
@KacperMadej

KacperMadej Nov 28, 2017

Contributor

@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?

Contributor

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