canGoBack
Control whether users can leave a jig, with an optional confirmation modal.
Use canGoBack on a jig to control whether users can leave the current screen.
It applies to all user-initiated back navigation from that jig, including:
Android hardware back
iOS swipe-back
The header back button
action.go-backandaction.go-totriggered from the jig

Where to use it
Configure canGoBack on any jig type.
Use it when you need to:
confirm before leaving a read-only screen
protect unsaved changes across multiple components
block navigation in kiosk-style flows
How it works
canGoBack has a required when condition and an optional confirm modal.
It resolves in three ways:
whenistrue— navigation proceedswhenisfalseandconfirmis set — a modal openswhenisfalseandconfirmis not set — navigation is blocked
Configuration options
when
boolean or Expression
Controls whether the user can leave the jig.
confirm
object
Optional modal shown when when resolves to false.
confirm.title
string or Expression
Modal title.
confirm.description
string or Expression
Modal body text.
confirm.confirm
string or Expression
Confirm button label.
confirm.cancel
string or Expression
Cancel button label.
confirm.style.isDanger
boolean
Styles the confirm button as a destructive action.
Considerations
It does not run in widgets, previews, or nested jig content.
In
jig.tabs, an inactive tab can still block leaving the screen.If a form still uses
isDiscardChangesAlertEnabled: true, the form discard alert still applies.Use a hard block carefully. It prevents all supported back navigation from that jig.
Examples
Confirm before leaving
This example blocks navigation when the jig is dirty and asks the user to confirm.
Hard block navigation
This example prevents leaving the jig with no modal.
Use a form's dirty state
This example moves the back-navigation rule to the jig level and uses the form state in the condition.
action.go-back uses the same rule
This example shows a back action inside the jig. The same canGoBack rule still applies, even when the action button is tapped.
Related topics
Last updated
Was this helpful?