Skip to content

[iOS] Fixing #28912 by only hiding context buttons when user already stopped dragging the cell #28914

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

Open
wants to merge 37 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
0d96f16
Fixed issue 26769 - crash when iOS app is running on MacOS and "More"…
VitalyKnyazev Dec 20, 2024
016424a
Merge branch 'dotnet:main' into main
VitalyKnyazev Mar 18, 2025
f3495ff
Merge branch 'dotnet:main' into main
VitalyKnyazev Mar 24, 2025
6773f1a
Fixed iOS cell resizing issue #23319, CellRenderer.GetCell may not be…
VitalyKnyazev Mar 28, 2025
8866e7b
Merge branch 'main' of https://github.com/VitalyKnyazev/maui
VitalyKnyazev Mar 28, 2025
87e67fc
Merge branch 'main' of https://github.com/VitalyKnyazev/maui
VitalyKnyazev Apr 2, 2025
8686af3
Merge branch 'main' of https://github.com/VitalyKnyazev/maui
VitalyKnyazev Apr 2, 2025
80ca3af
Merge branch 'main' of https://github.com/VitalyKnyazev/maui
VitalyKnyazev Apr 3, 2025
b31d9b1
Merge branch 'main' of https://github.com/VitalyKnyazev/maui
VitalyKnyazev Apr 6, 2025
73a9f92
Merge branch 'main' of https://github.com/VitalyKnyazev/maui
VitalyKnyazev Apr 7, 2025
a9ae654
Merge branch 'main' of https://github.com/VitalyKnyazev/maui
VitalyKnyazev Apr 10, 2025
5355600
Fixed potential NRE probably due to copy/paste bug
VitalyKnyazev Apr 10, 2025
2e9e7b0
Fixed #28912 by hiding context menu buttons only if user ever swiped …
VitalyKnyazev Apr 10, 2025
354572a
Better fix for #28912
VitalyKnyazev Apr 10, 2025
eb9001f
Merge branch 'dotnet:main' into main
VitalyKnyazev Apr 25, 2025
49bb174
Merge branch 'dotnet:main' into main
VitalyKnyazev Apr 29, 2025
2e019e9
Merge branch 'dotnet:main' into main
VitalyKnyazev Apr 29, 2025
401b9ae
Merge branch 'dotnet:main' into main
VitalyKnyazev May 3, 2025
7bd4409
Merge branch 'dotnet:main' into main
VitalyKnyazev May 9, 2025
4f8526d
Merge branch 'dotnet:main' into main
VitalyKnyazev May 12, 2025
419cdc9
Merge branch 'dotnet:main' into main
VitalyKnyazev May 13, 2025
b2cbec4
Merge branch 'dotnet:main' into main
VitalyKnyazev May 13, 2025
c3ab3dd
Merge branch 'dotnet:main' into main
VitalyKnyazev May 16, 2025
373799b
Merge branch 'dotnet:main' into main
VitalyKnyazev May 25, 2025
2081122
Merge branch 'dotnet:main' into main
VitalyKnyazev May 29, 2025
930cee5
Merge branch 'dotnet:main' into main
VitalyKnyazev Jun 4, 2025
f637f9a
Merge branch 'dotnet:main' into main
VitalyKnyazev Jun 6, 2025
61b082a
Merge branch 'dotnet:main' into main
VitalyKnyazev Jun 8, 2025
77c510b
Merge branch 'dotnet:main' into main
VitalyKnyazev Jun 12, 2025
86fdc67
Merge branch 'dotnet:main' into main
VitalyKnyazev Jun 14, 2025
b3d1c6b
Merge branch 'dotnet:main' into main
VitalyKnyazev Jun 22, 2025
81b5a04
Merge branch 'dotnet:main' into main
VitalyKnyazev Jun 25, 2025
b785421
Merge branch 'dotnet:main' into main
VitalyKnyazev Jun 29, 2025
f2cb360
Merge branch 'dotnet:main' into main
VitalyKnyazev Jul 1, 2025
b10002b
Merge branch 'dotnet:main' into main
VitalyKnyazev Jul 3, 2025
b6d3bcc
Merge branch 'dotnet:main' into main
VitalyKnyazev Jul 7, 2025
09d65fe
Merge branch 'dotnet:main' into main
VitalyKnyazev Jul 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ internal sealed class ContextScrollViewDelegate : UIScrollViewDelegate

bool _isDisposed;
static WeakReference<UIScrollView> s_scrollViewBeingScrolled;
bool _draggingEnded;
UITableView _table;

public ContextScrollViewDelegate(UIView container, List<UIButton> buttons, bool isOpen)
Expand Down Expand Up @@ -90,6 +91,11 @@ public override void DraggingStarted(UIScrollView scrollView)
RemoveHighlight(scrollView);
}

public override void DraggingEnded(UIScrollView scrollView, bool willDecelerate)
{
_draggingEnded = true;
}

public void PrepareForDeselect(UIScrollView scrollView)
{
RestoreHighlight(scrollView);
Expand All @@ -114,13 +120,14 @@ public override void Scrolled(UIScrollView scrollView)
b.Frame = new RectangleF(scrollView.Frame.Width + (count - (i + 1)) * ioffset, 0, width, rect.Height);
}

if (scrollView.ContentOffset.X == 0)
if (_draggingEnded && scrollView.ContentOffset.X == 0)
{
IsOpen = false;
SetButtonsShowing(false);
RestoreHighlight(scrollView);

s_scrollViewBeingScrolled = null;
_draggingEnded = false;
ClearCloserRecognizer(GetContextCell(scrollView));
ClosedCallback?.Invoke();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1655,7 +1655,7 @@ void UpdateNavigationBarVisibility(bool animated)
return;

var hasNavBar = NavigationPage.GetHasNavigationBar(current);
if (!_navigation.TryGetTarget(out NavigationRenderer navigationRenderer))
if (_navigation.TryGetTarget(out NavigationRenderer navigationRenderer))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While can understand the changes in the ContextScrollViewDelegate class, I think need more context here? why are you changing this condition?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this change is not related to the main issue, but it is clearly a copy/paste bug and can cause NRE in the next line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to roll back this one if needed

{
navigationRenderer._hasNavigationBar = hasNavBar;
}
Expand Down