Skip to content

Fix container scroll bounds by factoring child layout heights#445

Open
notdanilo wants to merge 1 commit into
DioxusLabs:mainfrom
notdanilo:main
Open

Fix container scroll bounds by factoring child layout heights#445
notdanilo wants to merge 1 commit into
DioxusLabs:mainfrom
notdanilo:main

Conversation

@notdanilo
Copy link
Copy Markdown

Proposed Changes

This PR fixes the scroll clamping issue #444 by computing a corrected scrollable height for scrollable containers based on their layout children's actual vertical bounds:

True Scrollable Area Calculation: Iterates through the container's layout children to find the bottom-most point (location.y + size.height) and factors in padding and border height. The maximum of this calculation and the default layout scroll height is used.

Impact

Ensures scrollable containers allow users to scroll fully to the bottom of all content.

@nicoburns
Copy link
Copy Markdown
Member

Hmm.. this seems to be compensating for the fact that Taffy's content size computation is wrong. I think we'd be better fixing it there. In your mind, is this still needed if we merge DioxusLabs/taffy#955 (or DioxusLabs/taffy#956)?

(separately, we may need to move content size / scroll overflow calculation out of Taffy and into Blitz so that we can account for transforms. But that should be a wider change that happens ahead of time and incrementally rather than being just-in-time computation on every mousemove event)

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.

2 participants