Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
 
Answered
showModal automatically close

To display a modal, I'm using the showModal action. My requirement is to close the modal without user interference. It should automatically close after 10 seconds. Can you provide guidance on how to achieve this?

Posted 2 years ago
Votes Newest

Answers 2


The modal is meant to be a blocking UI element that requires user interaction to bypass. It isn't currently designed for auto-closure. For that, we have showAlert which can show a non-blocking "toast" style notification to the end user. showAlert can be configured for closure or to auto-close after a set duration.

Here is an example of how you would call that today:

tecton.actions.showAlert({
    toastHeader: 'Verify Action',
    message: 'You have 10 seconds to cancel. Would you like to continue?',
    styleType: 'warning',
    closable: false,
    durationInMs: 10000,
    clickActionName: 'CONTINUE',
    hideActionName: 'CONTINUE',
    hasTimestamp: true,
    toastActions: [
        {
            label: 'Cancel',
            actionName: 'CANCEL',
        },
        {
            label: 'Continue',
            actionName: 'CONTINUE',
        },
    ],
})
.then((actionName) => {
    console.log(actionName);
});

Another option would be to create your own overlay with a route in your application and a overpanel. With the size and height options, you can create a modal-style overpanel that gives you full control of content in the overlay and the ability to call the closeOverpanel method on a timer.

https://tecton.q2developer.com/guides/overpanel-entrypoint/
https://tecton.q2developer.com/capabilities/showOverpanel/
https://tecton.q2developer.com/capabilities/closeOverpanel/


Hello Sai,

UUX doesn't support a method to close the modal via javascript. There are some weird ways to potentially accomplish this, but currently there is no easy or clean way to do this.

You could use an overpanel which has close overpanel, but unfortunately modal doesn't have this ability.

Thank you,
Trey Teter
Software Engineer

Posted 2 years ago
Trey Teter
489 × 4 Administrator
115 Views
2 Answers
2 years ago
2 years ago