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

Many Polaris components cannot work in the new Modal #301

Open
dungfv opened this issue Mar 6, 2024 · 6 comments
Open

Many Polaris components cannot work in the new Modal #301

dungfv opened this issue Mar 6, 2024 · 6 comments

Comments

@dungfv
Copy link

dungfv commented Mar 6, 2024

I noticed that many Polaris components cannot work in the new modal:

  • Popover
  • Tooltip
  • Drop zone

Additionally, drag & drop behaviors are also blocked in the new app bridge Modal.
This breaks my current application.

Originally posted by @dungfv in #238 (comment)

@darrynten
Copy link

You can see some of the issues caused by the modal document context we ran into here: #269

Maybe the iframe based solution will work for you

@dungfv
Copy link
Author

dungfv commented Mar 6, 2024

You can see some of the issues caused by the modal document context we ran into here: #269

Maybe the iframe based solution will work for you

Thank @darrynten. This works for me.
However, it makes many secondary resource calls and delays when loading the modal.
The actions in the modal also don't work directly, I have to use broadcast to communicate with the iframe.
I think we still need a better fixing from the library itself.

@charlesdobson
Copy link
Contributor

Hi @dungfv,

We're looking into this. Thanks for reporting!

@charlesdobson
Copy link
Contributor

Hi @dungfv,

We've added in support for a src prop to the modal to render the provided URL in an iframe. Docs are here. If using this, you can use the postMessage API for modal to main app communication - docs are here.

Please let me know if that works for you!

@mirceapiturca
Copy link

@charlesdobson does this mean that to use Polaris components like Popover or Tooltip in a modal we need to create a new route and postMessage back and forward cross iframes? In React?

@dungfv
Copy link
Author

dungfv commented Mar 15, 2024

@charlesdobson thank you for updating.
I just tested with new updates, fetching in the Modal context is unauthorized.
Until now, the solution of @darrynten is still better.

In my opinion, the new Modal behavior isn't friendly for both developers and end users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants