Skip to content
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

Modal view manager option based on ContentDialog #8880

Closed
rozele opened this issue Oct 21, 2021 · 2 comments
Closed

Modal view manager option based on ContentDialog #8880

rozele opened this issue Oct 21, 2021 · 2 comments

Comments

@rozele
Copy link
Collaborator

rozele commented Oct 21, 2021

Summary

Given the AlertModule depends on ContentDialog, and it includes behaviors to queue ContentDialogs before showing them, it would be great to create a general purpose ModalViewManager based on ContentDialog that leverages the same internal queue so we can add arbitrary React view content to a ContentDialog and have the same guarantee that showing this modal while another ContentDialog is being shown will not crash the app.

Motivation

We have a number of modals in our app, and the limitation of only showing one at a time is probably not a huge issue. These are custom modals attached to the root view, and do not match the general look and feel of ContentDialogs in XAML apps (because they are just custom content). While it is possible to create a custom native module / view manager that shows ContentDialogs, it would not be "safe" to do so because it wouldn't cooperate with the AlertModule to ensure only one ContentDialog is shown at a time.

Basic Example

No response

Open Questions

No response

@ghost ghost added Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) Partner: Facebook labels Oct 21, 2021
@asklar
Copy link
Member

asklar commented Oct 21, 2021

There is a request to implement Modal #2989 but we haven't done so yet.
I think the request boils down to either:
1- a native modal control that allows multiple instances simultaneously, and expose it to JS, or
2- an API to query / set whether modal dialogs are showing, and events to be notified when this changes, so that apps/modules can coordinate when to show the modal dialog / alert

The first one sounds like it would be a good thing to fix in XAML itself, since brownfield apps (with native components in them) could be using ContentDialog directly, and run into crashes this way. Can you file an issue in the winui repo?

@asklar asklar removed the Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) label Oct 21, 2021
@asklar asklar added this to the Backlog milestone Oct 21, 2021
@rozele
Copy link
Collaborator Author

rozele commented Oct 21, 2021

I'll close this one anyway, especially because I forgot that there are various XAML Islands issues with ContentDialog :)

@rozele rozele closed this as completed Oct 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants