fix(external pointer): avoid recursive-loops on pointer events#503
Merged
markov00 merged 2 commits intoelastic:masterfrom Jan 2, 2020
Merged
Conversation
If the consumer code doesn't take care of correctly distribute the pointer events avoiding feeding a chart with its own cursor position, it will end up with a recursive loop that ultimately throw a max stack trace. This provide the fix for such case BREAKING CHANGE: The `onCursorUpdate` Settings property is changed to a more generic `onPointerUpdate`. The same apply for the event type `CursorEvent` that is now `PointerEvent` and can assume a `PointerOverEvent` or `PointOutEvent` shape (see TS types)
Codecov Report
@@ Coverage Diff @@
## master #503 +/- ##
=========================================
+ Coverage 83.84% 84.55% +0.7%
=========================================
Files 158 169 +11
Lines 4729 4887 +158
Branches 963 983 +20
=========================================
+ Hits 3965 4132 +167
+ Misses 749 739 -10
- Partials 15 16 +1
Continue to review full report at Codecov.
|
4 tasks
markov00
pushed a commit
that referenced
this pull request
Jan 2, 2020
# [16.0.0](v15.0.5...v16.0.0) (2020-01-02) ### Bug Fixes * **external pointer:** avoid recursive-loops on pointer events ([#503](#503)) ([c170f0d](c170f0d)), closes [#504](#504) ### BREAKING CHANGES * **external pointer:** The `onCursorUpdate` Settings property is changed to a more generic `onPointerUpdate`. The same apply for the event type `CursorEvent` that is now `PointerEvent` and can assume a `PointerOverEvent` or `PointOutEvent` shape (see TS types)
Collaborator
Author
|
🎉 This PR is included in version 16.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
AMoo-Miki
pushed a commit
to AMoo-Miki/OpenSearch-Dashboards
that referenced
this pull request
Feb 10, 2022
# [16.0.0](elastic/elastic-charts@v15.0.5...v16.0.0) (2020-01-02) ### Bug Fixes * **external pointer:** avoid recursive-loops on pointer events ([opensearch-project#503](elastic/elastic-charts#503)) ([8f9c258](elastic/elastic-charts@8f9c258)), closes [opensearch-project#504](elastic/elastic-charts#504) ### BREAKING CHANGES * **external pointer:** The `onCursorUpdate` Settings property is changed to a more generic `onPointerUpdate`. The same apply for the event type `CursorEvent` that is now `PointerEvent` and can assume a `PointerOverEvent` or `PointOutEvent` shape (see TS types)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
If the consumer code doesn't take care of correctly distribute the pointer events avoiding feeding a chart with its own cursor position, it will end up with a recursive loop that ultimately throw a max stack trace. This provide the fix for such case.
BREAKING CHANGE: The
onCursorUpdateSettings property is changed to a more genericonPointerUpdate. The same apply for the event typeCursorEventthat is nowPointerEventand can assume aPointerOverEventorPointOutEventshape (see TS types)To test on previous version:
fix #504
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.src/index.ts(and stories only import from../srcexcept for test data & storybook)[ ] Proper documentation or storybook story was added for features that require explanation or tutorials