Giter VIP home page Giter VIP logo

Comments (8)

vhugogarcia avatar vhugogarcia commented on May 28, 2024 2

Hello @paulvarache , I was able to test your sample and it works partially in your sample, however, I found out the modal was not implemented correctly on the code sample you updated. With all respect and your permission, I went ahead and forked the repository and updated the sample here: https://github.com/vhugogarcia/The49.Maui.BottomSheet on the branch: modal-page

These are the changes:
vhugogarcia@bdbe679

In summary, I removed the flyoutmenuitem since for modal we should navigate using relative urls instead of absolute with ///. Also, I updated the command to use async.

If you download my update repository and run it on iOS emulator, you will find out that when you open the bottomsheet for Modal page and then TAP on Go To Modal button from the bottom sheet, you will see that nothing happens and the Visual Studio console will report this:

The49.Maui.BottomSheet.Sample[47070:500720] [Presentation] Attempt to present <Microsoft_Maui_Controls_Platform_ModalWrapper: 0x7fd21cfba910> on <Microsoft_Maui_Controls_Platform_Compatibility_ShellFlyoutRenderer: 0x7fd21dc1b2a0> (from <Microsoft_Maui_Controls_Platform_Compatibility_ShellFlyoutRenderer: 0x7fd21dc1b2a0>) which is already presenting <The49_Maui_BottomSheet_BottomSheetViewController: 0x7fd21db86ad0>.
The49.Maui.BottomSheet.Sample[47070:500720] [Presentation] Attempt to present <Microsoft_Maui_Controls_Platform_ModalWrapper: 0x7fd21db8dac0> on <Microsoft_Maui_Controls_Platform_ModalWrapper: 0x7fd21cfba910> (from <Microsoft_Maui_Platform_PageViewController: 0x7fd21cf99040>) whose view is not in the window hierarchy.

Let me know if there is anything else I can help with to reproduce the issue.

Note: Also, if you try to show an alert from the BottomSheet it won't work.
image

Thanks for looking into.

from the49.maui.bottomsheet.

paulvarache avatar paulvarache commented on May 28, 2024

Hi, thanks for your support.

Could you confirm this is happening on Android iOS or both? This would help isolating the issue

from the49.maui.bottomsheet.

vhugogarcia avatar vhugogarcia commented on May 28, 2024

Thanks for the fast response @paulvarache

I can confirm the issue occurs on iOS only (tested on emulators and physical devices). On Android, the modal is being loaded as expected without dismissing the bottom sheet.

I'm using the package The49.Maui.BottomSheet 1.0.0-rc1

Let me know if there is any other information you need from me.

Regards,
Victor

from the49.maui.bottomsheet.

paulvarache avatar paulvarache commented on May 28, 2024

Hi, I wasn't able to reproduce this. I managed to get a shell modalAnimated page opening from a tapgesturerecognizer within a bottom sheet.

The sheet does stay on top of the newly opened page, but that is the behaviour for bottom sheets on both Android and iOS, so it is up to the use to dismiss and show in sync with any newly opened page if needed.

Let me know if this is still an issue you have with more recent versions too as some things have changed which might help with your specific issue.

I've left an example in the sample project that opens a shell modal page if you want to check it out yourself

from the49.maui.bottomsheet.

vhugogarcia avatar vhugogarcia commented on May 28, 2024

Thanks @paulvarache, I will take a look today and update to the new version and test. 🙂

from the49.maui.bottomsheet.

paulvarache avatar paulvarache commented on May 28, 2024

Hi,

I finally got to this issue and I have hit a wall for now.

For those who are interested in the implementation details:

Displaying an Alert, Modal page or bottom sheet on iOS PresentViewController is used. This requires using the top most presented controller or iOS will not show the new Alert/Modal/Sheet.

This project simply finds the root view controller from the window. This mean it works when no alert or modal is presented.

As a fix, I will change it so it uses the top most view controller, this means sheets should work from within modals

The issue comes with Alert/Modal from a sheet. MAUI uses its own logic to find which view controller to use. If any modal is used, it walks down the list and gets the top most modal, otherwise it uses the window's root view controller.

The view controllers this project creates and presents are taken in account in MAUI's logic, meaning MAUI tries to present the Alert/Modal from a view controller that already presents the BottomSheet and iOS fails.

What I have tried:

I tried creating a new UIWindow, and displaying the sheet from there. This works, BUT iOS doesn't animate the app's UIWindow as the BottomSheet reaches the top of the display.

I tried replacing the app's RootViewController with a dummy one when presenting the sheet (or the modal's viewcontroller). This tricks MAUI into using our own ViewController instead of the default one when the sheet is opened. This works in some cases, but in other cases, iOS complains that we're trying to present a view controller from a detached view controller.

Closing the sheet before displaying alerts or navigating to a modal seems to be the only way for now.

I will open an issue on the maui repo asking about this scenario, but I can't imagine this being too much of a priority

from the49.maui.bottomsheet.

vhugogarcia avatar vhugogarcia commented on May 28, 2024

Thanks @paulvarache for looking into the issue. And I think opening a ticket in .NET MAUI may help to solve this mystery.

And not a problem. We can in the meantime continue dismissing the bottom sheet and show a modal or so.

Really appreciate the time you put into this issue. Let me know if there is anything I can help with :)

 

from the49.maui.bottomsheet.

tj-devel709 avatar tj-devel709 commented on May 28, 2024

@paulvarache Hey, I'm TJ from the Maui Team and was wondering if you opened an issue regarding this on the MAUI Repo?

from the49.maui.bottomsheet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.