[ML] Fix tooltip positioning.#49160
Merged
walterra merged 5 commits intoelastic:masterfrom Oct 24, 2019
Merged
Conversation
Contributor
|
Pinging @elastic/ml-ui (:ml) |
Contributor
💔 Build Failed |
| const chartTooltipState = useObservable(chartTooltip$); | ||
| const ref = useRef<RefValue>(null); | ||
|
|
||
| return (node: RefValue) => { |
Member
There was a problem hiding this comment.
this could return a named function called something like setChartTooltipElement?
Contributor
Author
There was a problem hiding this comment.
It's a wrapper for useRef() which just returns one object also, so I'd like to keep it the same (https://reactjs.org/docs/hooks-reference.html#useref)
Contributor
💚 Build Succeeded |
peteharverson
approved these changes
Oct 24, 2019
Contributor
peteharverson
left a comment
There was a problem hiding this comment.
Tested latest updates, including on IE11, and LGTM!
Contributor
💚 Build Succeeded |
walterra
added a commit
to walterra/kibana
that referenced
this pull request
Oct 24, 2019
- Moves all DOM manipulation to a ref callback for the ChartTooltip react component. The service mlChartTooltipService no longer touches the DOM, it just passed around data and triggers the chartTooltip$ observable which the ChartTooltip is subscribed to. The code infers positioning now from the tooltips parent element and we no longer rely on hard-coded Kibana classnames. Besides that the code to determine the position remains the same (with some offset tweaking). - The mocha tests for mlChartTooltipService have been migrated to jest.
walterra
added a commit
to walterra/kibana
that referenced
this pull request
Oct 24, 2019
- Moves all DOM manipulation to a ref callback for the ChartTooltip react component. The service mlChartTooltipService no longer touches the DOM, it just passed around data and triggers the chartTooltip$ observable which the ChartTooltip is subscribed to. The code infers positioning now from the tooltips parent element and we no longer rely on hard-coded Kibana classnames. Besides that the code to determine the position remains the same (with some offset tweaking). - The mocha tests for mlChartTooltipService have been migrated to jest.
walterra
added a commit
that referenced
this pull request
Oct 25, 2019
- Moves all DOM manipulation to a ref callback for the ChartTooltip react component. The service mlChartTooltipService no longer touches the DOM, it just passed around data and triggers the chartTooltip$ observable which the ChartTooltip is subscribed to. The code infers positioning now from the tooltips parent element and we no longer rely on hard-coded Kibana classnames. Besides that the code to determine the position remains the same (with some offset tweaking). - The mocha tests for mlChartTooltipService have been migrated to jest.
walterra
added a commit
that referenced
this pull request
Oct 25, 2019
- Moves all DOM manipulation to a ref callback for the ChartTooltip react component. The service mlChartTooltipService no longer touches the DOM, it just passed around data and triggers the chartTooltip$ observable which the ChartTooltip is subscribed to. The code infers positioning now from the tooltips parent element and we no longer rely on hard-coded Kibana classnames. Besides that the code to determine the position remains the same (with some offset tweaking). - The mocha tests for mlChartTooltipService have been migrated to jest.
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
Fixes #48868.
refcallback for theChartTooltipreact component. The servicemlChartTooltipServiceno longer touches the DOM, it just passed around data and triggers thechartTooltip$observable which theChartTooltipis subscribed to. The code infers positioning now from the tooltips parent element and we no longer rely on hard-coded Kibana classnames. Besides that the code to determine the position remains the same (with some offset tweaking).mlChartTooltipServicehave been migrated to jest.Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n supportDocumentation was added for features that require explanation or tutorialsThis was checked for keyboard-only and screenreader accessibilityFor maintainers