-
Notifications
You must be signed in to change notification settings - Fork 9
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
What happend to Modal App Bridge #238
Comments
It's currently being worked on and will be released soon! I'll update here when it's out |
Any workaround I can get it done right now? Perhaps old version of App Bridge I can use? |
For now, your best bet is to use one of the App Bridge I don't have a date that Modal will be released on the new App Bridge, but it should be within the next month or two! Just wrapping up some final API considerations. |
Looking forward to it. Missing Modal is deal breaker for App Bridge 3 > 4 upgrade at the moment. |
ARGGGGG... if I had know this library was unusable like this, I would never have adopted it for my latest updates. I feel ripped off and have wasted hours. Grrrrr... |
Button is also missing 4.x seems like a big L |
@darrynten The App Bridge from npm |
We currently use buttons:
|
We added Modals with custom DOM content! Check it out: https://shopify.dev/docs/api/app-bridge-library/reference/modal |
I am having issues using ui-modal in a Remix app. My react components seem to not call their interaction callbacks with this modal. Buttons don't call onClick for example. Any advice on how to address this issue? for a brief example, here is a Remix route
|
This is because they are using webcomponents, but for some reason Polaris uses React, the only way that I managed to fix this is this to wrap the "ui-modal" around a ref, can probably also give a ref to ui-modal, but typescript will indicate an error:
|
Still can't |
I tried it here and it won't work with Polaris "Button" you have use the HTML native "button" instead. I don't know why they want us use to use the modal API when react has it's own logic that doesn't integrate well with other technologies. |
I used the HTML native "button" instead,but still can't.Help!!! |
The "native" components are great, until they are not. In my experience, just switching to a legacy component (e.g. Polaris Modal) when things don't work your way is a very productive solution. You can always revisit the other approach at a later point in time. |
I'm using the Remix template for development of my app but going out of the React architecture with this web-component is rather inconvenient. I can't even use interactive Polaris components inside that modal such as buttons with click callbacks because they don't work anymore. Anyone here using the Remix template, what did you do to remedy this? Use the previous version of app brigde react? use deprecated polaris modals? make your own modals? would love to know and get inspired by your ways so I can find the best solution to use Polaris inside my modals! |
I also cannot get this modal to work. The Polaris modal component is deprecated, callbacks not working for me. And the replacement isn't working. So am I just SOL? |
@charlesdobson hi :)
or how to not get VS error
|
For this, just update the shopify packages in your But to continue the actual problem, can we make somehow this component load the react needed for it to work within its iFrame if used within a React/Remix context ? |
The modal component itself works well and seems to be using native Browser APIs under the hood (good), but I am flabbergasted why they would build a Modal with its own internal API for state. This completely breaks how React conceptualizes state, and it's incompatible with other Polaris components. What was the reason behind the change? |
@tylerhellner to "increase friction" to prevent "incorrect usage" Shopify/polaris#11460 |
I'm astounded by the choice to eliminate Modal support in the newest release. Modals play a key role in improving user experience and simplifying navigation. It's disheartening that this functionality has been phased out without offering a clear substitute. |
I have then now resorted to using the But so far is the only way I can have a modal and stay within the React system. |
Does anyone have a workaround for this yet? I'm facing the issue that callbacks are not working for me. |
We've just released App Bridge React v4 which includes a React wrapper for the
https://shopify.dev/docs/api/app-bridge-library/react-components/modal See the migration guide for more info |
how do I prevent |
I noticed that many Polaris components cannot work in the new modal:
Additionally, drag & drop behaviors are also blocked in the new app bridge modal. |
@handhikadj see #297 for how to listen to the event, maybe you can cancel the event or just call the open event again in the close event |
Any update regarding this issue? I'm attempting to utilize the datepicker within the modal's popover, but it's not functioning correctly. Instead, the popover appears on the page behind the modal. |
#331 |
We're experiencing the same issues with drag & drop in the new AppBridge modal. I opened a dedicated issue here: #364 |
### WHY are these changes introduced? Fix issues related to overlays not working correct in App Bridge modals as outlined in this [doc](https://docs.google.com/document/d/1eocCl07pk8xt7rvUaGDWZzfJxxeJ2yRi1ul0x0ezkDM/edit). These specific issues will be fixed - Shopify/shopify-app-bridge#316 - Shopify/shopify-app-bridge#264 (comment) - Shopify/shopify-app-bridge#238 (comment) - Shopify/shopify-app-bridge#301 ### WHAT is this pull request doing? Currently Overlays are broken when rendered using React portals. This PR fixes the issue by doing the following: - ensuring all references to `document` are updated to be `node.ownerDocument` instead so the positioning can be calculated correctly inside of iframes - ensuring wherever we do `instanceOf HTMLElement` we instead just check to see if the node is present or try to call the related methods (`getBoundingClientRect`) with a fallback as the `instanceof` check will fail when using React portals for iframe content since iframes have their own globals This PR only touches the related utils for Overlays but there are other references to `document` and `instanceOf HTMLElement` we should also update. Expected usage with App Bridge v4, note that you have to wrap the modal's content with the AppProvider from Polaris so that the portals are created in the correct place. For example, here's a modal with tooltips inside: ```jsx import {AppProvider} from '@shopify/polaris'; import {Modal} from '@shopify/app-bridge-react'; function App() { return ( <Modal> <AppProvider i18n={{}}> <div style={{padding: '75px 0'}}> <Tooltip content="This order has shipping labels."> <Text fontWeight="bold" as="span"> Order #1001 </Text> </Tooltip> <ButtonGroup variant="segmented" fullWidth> <Tooltip content="Bold" dismissOnMouseOut> <Button>B</Button> </Tooltip> <Tooltip content="Italic" dismissOnMouseOut> <Button>I</Button> </Tooltip> <Tooltip content="Underline" dismissOnMouseOut> <Button>U</Button> </Tooltip> <Tooltip content="Strikethrough" dismissOnMouseOut> <Button>S</Button> </Tooltip> </ButtonGroup> </div> </AppProvider> </Modal> ); } ``` **Before** https://github.com/user-attachments/assets/f7b7a7df-f25f-422c-a5bc-d1a8d7f12167 **After** https://github.com/user-attachments/assets/6c1bf97a-e8f4-4715-9960-9f5709222f75 https://github.com/user-attachments/assets/ebc4755e-cc3b-413a-aaf5-9f39cc7b7ad0 ### How to 🎩 🖥 [Local development instructions](https://github.com/Shopify/polaris/blob/main/README.md#install-dependencies-and-build-workspaces) 🗒 [General tophatting guidelines](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md) 📄 [Changelog guidelines](https://github.com/Shopify/polaris/blob/main/.github/CONTRIBUTING.md#changelog) 1. Open the App Bridge Playground: https://admin.shopify.com/store/trish-dev/apps/app-bridge-next-playground-4/react/index.html 2. Open all the custom content modals and do a smoke test to verify overlay components are rendered on top with correct sizing and click events are working ### 🎩 checklist - [X] Tested a [snapshot](https://github.com/Shopify/polaris/blob/main/documentation/Releasing.md#-snapshot-releases) - [X] Tested on [mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing) - [X] Tested on [multiple browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers) ~- [ ] Tested for [accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md)~ ~- [ ] Updated the component's `README.md` with documentation changes~ ~- [ ] [Tophatted documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md) changes in the style guide~
Modal in App Bridge is no longer supported in the most recent version. I feel like modals are an important part of shopify admin and avoid a lot of back and forward page navigation!...
The text was updated successfully, but these errors were encountered: