-
Notifications
You must be signed in to change notification settings - Fork 337
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
[BUG] Snackbar messages don't anchor properly on iOS #1884
Comments
@KeithBoynton , Is the behavior you expect below? So, if Anchor is placed at the top of the screen, which of the following is the expected behavior? [Case 1] [Case 2] If Anchor is inside the scroll view, case 2 will behave as follows. iPhone.15.iOS.17.0.2024-05-17.16-17-42.mp4Both require code modifications on the Community Toolkit side. |
Thanks for the quick reply @cat0363 Case 2 looks correct if the element being anchored to is at the top of the screen, although I hadn't considered that as I'm not anchoring to an element at the top of the screen. But if I was I imagine that's what I'd want. Your illustration for when it's in a scroll view looks correct too. Thanks again! |
@KeithBoynton , Thank you for your reply. By the way, Case 1 can be implemented by making the following changes. [src\CommunityToolkit.Maui.Core\Views\Alert\AlertView.macios.cs]
|
I forgot to mention this, but in the case of Android, if you specify an anchor for the Snackbar using the SetAnchorView method, the Snackbar will be displayed above the Anchor. For this reason, it is not possible to display the Snackbar below Anchor on Android. The other day, I showed a pattern for Case 2, but Android cannot support Case 2, so if it is a pattern for Case 1, I can create a PR. |
The fact that the snackbar does not properly "stack" on top of its |
Thanks @raginmari! Could you submit a PR with the fix? |
Is there an existing issue for this?
Did you read the "Reporting a bug" section on Contributing file?
Current Behavior
When anchoring snackbar messages to a UI element on iOS they are not getting anchored above the specified UI element as would be expected. However, on Android they are anchored correctly.
iOS not working, it should be displayed above the button:
Expected Behavior
I would expect the snackbar message to be displayed just above the UI element it has been anchored to but on iOS it is displayed in the same (default) place as when no anchor is provided.
Andoid working as expected, above the button:
Steps To Reproduce
Link to public reproduction project repository
https://bitbucket.org/KeithBoynton/snackbar-anchor/src/master/
Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: