-
Notifications
You must be signed in to change notification settings - Fork 49
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
Android: Control (Like Entry) don't work coming back when using Mopups to transition between two pages. #93
Comments
OMG, it took me hours to figure out what grabs the focus of the Entries in my Maui Android App. In our App, we have a small permanently visible popup with Some sort of flag would be a good idea IMO. |
@DigitalNut could you put together a small repo, will take a look |
@christianrr not quite sure what your use case is here If you have a popup permanently on top of ur content then people won't be able to interact with the content behind it. Removing the accessibility handling would mean people using the screen reader on will be able to interact with the stuff behind the popup So youd end up with people having different levels of interactivity. But we could relatively easily add a |
@IeuanWalker We use a popup for a custom (styled) tab bar, which overlays all Shell pages and allows for animations of the tab bar on page transitions. All content pages have set a padding accordingly. As overriding the tab bar appearance of Maui Shell is not an easy one, this "workaround" works perfectly for us. The interaction with page content works well. Find a repo attached: |
@IeuanWalker Sample project is attached in above reported issue. |
@DigitalNut this should be fixed once the linked PR is merged and released. @christianrr once the linked PR is merged and released, there will be a new property you can add too your popup |
Excellent work @IeuanWalker merged it in. Lets hope it sorts it out |
Use the basic Maui sample app in Visual Studio to test this. Add Mopups NuGet package
MopupService.Instance.PushAsync(BusyPopup, false);
). Also add control/action to go to Page2 after the popup.MopupService.Instance.PopAsync(true);
) inOnAppearing()
. Also add a way to go back to page 1. If using the Maui sample app, this should be done for youSample project to reproduced this issue:
MauiMopupsTest.zip
Now when you run the program, notice that you can input text into the Entry control. Next press the button to go to page 2. This should bring up the popup and when page 2 is loaded the popup should disappear. Now press the button to go back to page 1. Press/touch the Entry control. Notice that the Entry control does not receive focus and no soft keyboard shows up.
The issue is caused by the setting of
DescendantFocusability
property inHandleAccessibility
(AndroidMopups.cs).I noticed that RG.Plugins.Popup does not set this property. The closing of the popup causes this flag to be reset on current page, which is Page2. But the popup was brought up from Page1, which
HandleAccessibility
will set this toDescendantFocusability.BlockDescendants
. So when you go back to Page1, the Entry control is blocked.We use this mechanism to bring up a busy popup for long tasks (load resources) than load the next page (as the page can be complex which takes time to load on some phones).
Is this property change required? Can a flag / option be used to control this behavior in the future?
One work around is to close the popup between page changes. Another work around (not modifing Mopups) is to add this code to your page that requires input, then on the OnAppearing() function call function:
Note: Add
#if ANDROID
around functionusing Android.Views;
The text was updated successfully, but these errors were encountered: