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

ENYO-5904: Fix TooltipDecorator to position tooltips within non-root floating layers #2189

Closed
wants to merge 2 commits into from

Conversation

ryanjduffy
Copy link
Contributor

Checklist

  • I have read and understand the contribution guide

  • A CHANGELOG entry is included

  • At least one test case is included for this feature or bug fix

  • Documentation was added or is not needed

  • This is an API breaking change

Issue Resolved / Feature Added

When tooltips are rendered within non-root FloatingLayers as is the case in VideoPlayer, they are positioned incorrectly based on the viewport rather than the layer into which they are rendered.

Resolution

  • Add node to the FloatingLayer.onOpen payload to use as a reference point for positioning elements within the layer
  • Update the positioning logic of Tooltip to "relativize" the bounds based on the floating layer

Additional Considerations

Instead of updating onOpen, we could "find" the node using closest() DOM API but would require breaking encapsulation since there's no way from TooltipDecorator to "tag" the floating layer. Any props added to FloatingLayerBase are attached to a child of the node that is establishing the positioning context. Given that, exposing the node seemed like the right API but open to alternatives.

Ryan Duffy added 2 commits April 3, 2019 15:48
Signed-off-by: Ryan Duffy <ryan.duffy@lge.com>
Signed-off-by: Ryan Duffy <ryan.duffy@lge.com>
@codecov
Copy link

codecov bot commented Apr 3, 2019

Codecov Report

Merging #2189 into develop will decrease coverage by 0.03%.
The diff coverage is 21.42%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2189      +/-   ##
===========================================
- Coverage    45.65%   45.61%   -0.04%     
===========================================
  Files          247      247              
  Lines         9748     9754       +6     
  Branches      2450     2451       +1     
===========================================
- Hits          4450     4449       -1     
- Misses        3889     3895       +6     
- Partials      1409     1410       +1
Impacted Files Coverage Δ
...ges/moonstone/TooltipDecorator/TooltipDecorator.js 23.52% <0%> (-1.48%) ⬇️
packages/ui/FloatingLayer/FloatingLayer.js 65.57% <100%> (-1.64%) ⬇️
packages/moonstone/TooltipDecorator/util.js 7.46% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b041005...2729541. Read the comment docs.

@Djspaceg
Copy link
Member

Djspaceg commented Apr 3, 2019

This may be simplified by leveraging the new relative positioning prop in the updated Tooltip branch.
See: feature/ui-update...feature/PLAT-76464-blakestephens#diff-b6e1e31265f4f342f40103f18a87f737R88

@ryanjduffy ryanjduffy closed this Apr 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants