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

Ensure the iOS ScrollView content container is at least the ScrollView size #8451

Merged
merged 2 commits into from Jul 4, 2022

Conversation

hartez
Copy link
Contributor

@hartez hartez commented Jun 30, 2022

Description of Change

For various reasons, the ScrollView is using a container ContentView to hold all the stuff in the ScrollView on iOS. If the container isn't large enough for the content, the content will still layout and display just fine, but the hit testing won't work for any part of the content outside the bounds of the container.

These changes ensure that the container is large enough to contain the content so that the hit testing works. They also fix an issue where ScrollView content did not properly account for SafeArea (drawing some content outside the safe area even when the content requested otherwise), and fix an issue where vertical alignments other than Fill were slightly off-alignment inside of ScrollView (when the content itself was smaller than the viewport size).

Issues Fixed

Fixes #8446

@hartez hartez linked an issue Jun 30, 2022 that may be closed by this pull request
@mattleibow mattleibow modified the milestone: 6.0-sr2 Jun 30, 2022
@jsuarezruiz jsuarezruiz added the area/layout 🔲 StackLayout, GridLayout, ScrollView, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter label Jul 1, 2022
@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@mattleibow
Copy link
Member

The device test failure is unrelated and @PureWeen has a fix coming.

@mattleibow mattleibow merged commit 5f66ee7 into net6.0 Jul 4, 2022
@mattleibow mattleibow deleted the fix-8446 branch July 4, 2022 16:57
mattleibow pushed a commit that referenced this pull request Jul 6, 2022
…w size (#8451)

Co-authored-by: Shane Neuville <shneuvil@microsoft.com>
@gbelmont22
Copy link

Has this fix also been merged into net7.0 ? I am seeing this behavior on iOS using a VericalStackLayout as a BindableLayout inside a ScrollView. The ScrollView also contains a button, used to add a new element to the collection that the BindableLayout is bound to. So the process is 1. the button works, 2. the user clicks the button, 3. a new element is added to the bound collection and so it is displayed in the BindableLayout, 4. rinse and repeat until the button is pushed off the bottom of the screen, 5. click events stop firing. If the button is half-on and half-off the display, you can scroll it to be fully visible, but only the top half responds to click events.

@mattleibow mattleibow added the backport/suggested The PR author or issue review has suggested that the change should be backported. label May 22, 2023
@hartez hartez removed the backport/suggested The PR author or issue review has suggested that the change should be backported. label May 24, 2023
@hartez
Copy link
Contributor Author

hartez commented May 24, 2023

Has this fix also been merged into net7.0 ?

Yes, it was merged before net7.0 was first released.

I am seeing this behavior on iOS using a VericalStackLayout as a BindableLayout inside a ScrollView. The ScrollView also contains a button, used to add a new element to the collection that the BindableLayout is bound to. So the process is 1. the button works, 2. the user clicks the button, 3. a new element is added to the bound collection and so it is displayed in the BindableLayout, 4. rinse and repeat until the button is pushed off the bottom of the screen, 5. click events stop firing. If the button is half-on and half-off the display, you can scroll it to be fully visible, but only the top half responds to click events.

I think you're seeing a newer bug that's popped up: #14624

@github-actions github-actions bot locked and limited conversation to collaborators Dec 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/layout 🔲 StackLayout, GridLayout, ScrollView, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Buttons (or clicking) don't seem to work properly in scrollviews
5 participants