Baseflow/Xamarin-Sidebar

ChangeContentView() problem causes existing views to have tap events hidden.

roflkins opened this issue · 1 comments

ChangeContentView() does not correctly remove the _tapGesture recognizer from the existing view when the menu is open, causing it to no longer receive any tap events if the view is re shown when calling the ChangeContentView()

My suggested change starts after line 267 at SidebarController.cs:

public void ChangeContentView(UIViewController newContentView) {
            if (_contentAreaView != null)
{
                _contentAreaView.RemoveFromSuperview();
//Ensure the old gesture recognizers are removed from the view to prevent usability conflicts, especially if this view is re shown at a later time.
if (_tapGesture != null && IsOpen)
 _contentAreaView.RemoveGestureRecognizer (_tapGesture);

if (_panGesture != null)
 _contentAreaView.RemoveGestureRecognizer (_panGesture); 
}
......

Thank you for the suggestion. Sorry for the delay but I've gotten this integrated into the codebase. It should be up in the Component Store within a few days.