Open
Conversation
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
Fixed mobile view for stakeholder details by refactoring the logic to give the stakeholder parent (Mobile.jsx) a responsive height that never exceeds the bottom of the device.
Problem
The StakeholderDetails component had position tracking logic to add padding based on the draggable panel position, but this approach needed to be fixed every time a new component was added.
If added at the top of StakeholderDetails (announcements for example), the StakeholderDetails parent would extend past the bottom of the device, making it impossible to see the last part of the stakeholder
information.
Adding a new component to the bottom (outdated information) it would not show up since the parent end is behind the bottom of the device and the padding bottom is not enough to bring the component back into view.
Solution
The solution is not straightforward because the overlay has
position: absolute, so managing its height is not as simple as usingflex: 1like we would in a normal flexbox flow.The new implementation controls the height of the overlay dynamically using
positionY. Instead of the panel extending beyond the bottom of the device, thebottomproperty is calculated usingpositionY.When the user drags the panel,
positionYrecalculates the overlay height as the difference between the screen height and the distance from the top of the screen to the handle. This recalculation happens on every drag event, so the overlay always ends exactly at the bottom of the screen.This means adding or changing components inside StakeholderDetails will never break the layout, since the height is always driven by the panel position, not by hardcoded padding values.
old.mov
new.mov
Changes
usePositionandpaddingBottomstate from StakeholderDetailsoverlaytogetOverlayStyleand passedpositionYas parameterheight: 100%to usetop: 0andbottom: positionYinsteadflex: 1for content to fill available space without exceeding device height in Mobile.jsxhandleDraghandler for handling position updates during dragTest
Fix #2661