-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
bugfix/13353-handling-passive-events #14357
Conversation
Visual test results - No difference found |
File size comparison
|
Thanks! As I noted in the original PR, I was concerned about the added complexity when allowing an event handler to be a config object instead of a function:
Did we check this out? Have we concluded that we actually need the added complexity? |
I tested all the cases that I could think of where we are calling
We don't need it internally. Internally, we can decide whether an event should be passive or not before adding an event (as I did). We can get rid of it and wait for users to request, however, it's already implemented - it's your call whether you want to keep it or add it later/never. |
In my experience it's better to be minimalistic and tight on the features than to add features and complexity that is rarely used. @pawelfus , @oysteinmoseng what do you think? |
Given the popularity of the issue, I would say fix it all |
How much overhead is it to support the event config objects? If it is a lot, I suppose the alternative is to make user-provided touch events passive by default. That should cover most cases without having to add complexity. |
@oysteinmoseng You can read that from the code in this PR, as it is implemented here. |
If we decide to go all in, we should refactor out the part where we It is currently implemented in Chart.ts and Interaction.ts. But should also be applied in Axis.ts and possibly PlotLineOrBand.ts |
If I am reading it correctly that's just 8 or so lines of extra code so far? That being said, there is the refactor mentioned by Torstein, and it looks like it is not added to the API documentation yet, and it is extra complexity to explain to users. Unless I am missing something, the only value we are adding here is that users can add touch events that call I am leaning towards not implementing this for now. |
Me too... So far, "it may come in handy sometime in the future" has not been a valid reason to add something to Highcharts.
@pawelfus Don't you think that's mainly because of the error message in the console, that will be fixed under any circumstance? |
Hmm.. good point. I just realized, after Oystein's comment, that only touch events need this change (and a few of
Actually, instead of refactoring, we could change |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, we need a decision...
I hereby decide that we implement passive events for our internal events, but not for custom events added through chart config. That way we solve the initial reported issue, and we don't overcomplicate our API options structure.
In the future, if frequently requested, we can consider support for passive events through the API options structure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Fixed #11353, added support for passive events.
This PR is a continuation of #13933 (can be closed). I couldn't resolve some issues again so had to install a fresh repo.