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

Fix the position of the popup menu after rubberband select when there is a margin on the component e.g. in embedded #1747

Merged
merged 1 commit into from
Feb 27, 2021

Conversation

cmdcolin
Copy link
Collaborator

Currently the embedded mode, most clearly, can have an example where the "Zoom to region" menu after a rubberband selection is shown in the wrong place

To properly place the menu using anchorPosition it should use left: event.clientX, top: event.clientY from the mouseup event (these are screen coordinates instead of offset to any particular element)

Found while looking at the storybook :)

@github-actions github-actions bot added the needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) label Feb 27, 2021
@cmdcolin cmdcolin changed the title Add note about clientX/Y for use on the anchorPosition Fix the position of the popup menu after rubberband select when there is a margin on the component e.g. in embedded Feb 27, 2021
@codecov
Copy link

codecov bot commented Feb 27, 2021

Codecov Report

Merging #1747 (efab8c7) into master (49862a1) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1747      +/-   ##
==========================================
- Coverage   58.81%   58.80%   -0.02%     
==========================================
  Files         454      454              
  Lines       20999    21001       +2     
  Branches     4974     4974              
==========================================
- Hits        12351    12350       -1     
- Misses       8338     8341       +3     
  Partials      310      310              
Impacted Files Coverage Δ
...iew/src/LinearGenomeView/components/RubberBand.tsx 85.59% <100.00%> (+0.24%) ⬆️
...inearGenomeView/components/RefNameAutocomplete.tsx 89.36% <0.00%> (-4.26%) ⬇️
packages/core/util/index.ts 82.20% <0.00%> (-0.33%) ⬇️

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 49862a1...efab8c7. Read the comment docs.

@cmdcolin
Copy link
Collaborator Author

This diff can help test things like this in the main app

diff --git a/packages/core/ui/ViewContainer.tsx b/packages/core/ui/ViewContainer.tsx
index 57fc28962..ca31964c3 100644
--- a/packages/core/ui/ViewContainer.tsx
+++ b/packages/core/ui/ViewContainer.tsx
@@ -20,7 +20,7 @@ const useStyles = makeStyles(theme => ({
   viewContainer: {
     overflow: 'hidden',
     background: theme.palette.secondary.main,
-    margin: theme.spacing(0.5),
+    margin: theme.spacing(50),
   },
   icon: {

@cmdcolin cmdcolin added bug Something isn't working and removed needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) labels Feb 27, 2021
@cmdcolin cmdcolin merged commit d5d643b into master Feb 27, 2021
@cmdcolin cmdcolin deleted the embedded_mode_menu_anchorpos branch February 28, 2021 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant