Modals can only currently be opened by buttons with the command “–show”. I was trying to do a better UI for one of our feature with a clickable component, though I found out that I could not open a confirmation modal with this component I was working on.
I was trying to do a clickable tile like that:
I was hoping I could programatically open a modal on the clickable click event but didn’t find any way of doing so.
Hi there,
Yeah POS extensions are pretty limited on this front right now, modal triggering is basically tied to the button --show command and there’s no programmatic way to open one from a custom click event on a Tile or other component.
The workaround most people end up going with is navigating to a separate screen instead of using a modal. Something like this:
const navigation = useNavigation();
// on your Tile press
navigation.navigate('confirmation-screen');
Not as clean as a modal overlay but it gets the job done for confirmation flows. If the confirmation screen approach works for your use case it’s probably the most reliable path right now given the POS extension constraints.
Right, I’ve been using screens for a couple of things, my screenshot is actually from a “Load” button that goes to a 2 choice load option screen. I didn’t really consider it because I’m already 3 screen deep at this point and I felt like it was starting to be a bad UX but maybe it doesn’t matter that much 
Though, I feel like the development experience for the POS is really painful right now (it even seems to have degraded a bit with the new web components). So many little basic things that are not possible with the current components.
So I decided to open tickets for most of the little annoyance I find! Hopefully some of those will get acknowledged at some point and improved a bit 