Repository navigation
fix(ui-components): resize overlays from their top left corner - #1049
Merged
Merged
Conversation
Overlays such as Collections Info are positioned with a bottom/right anchor, so dragging the bottom right resize handle grew them towards the top left and could push them off screen. Re-anchor the overlay by its top left corner when a resize starts, keeping it where it is on screen. Fixes HSF#1048
|
🚀 Preview deployed: http://phoenix-pr-1049.surge.sh Built from 67b464e. |
This branch was successfully deployed
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.
Fixes #1048.
Cause: Collections Info (and the other right-dock overlays) are opened with a CDK global position strategy anchored at
bottom/right. Dragging the bottom right resize handle therefore grew the panel towards the top left, which is the corner that appeared to move, and it could be resized off screen.Fix: when a resize starts,
OverlayComponentre-anchors the pane by its top left corner (wrapper aligned to flex-start, margins converted so the pane does not jump on screen). Dragging the handle now moves the bottom right corner.Testing: added a unit test covering the re-anchoring; it fails without the change. The overlay specs pass (19 tests), and prettier and eslint are clean. I have not checked the behaviour by hand in a browser, so a visual check of dragging Collections Info and the geometry/event browsers would be welcome.