ConfirmationDialogConfiguration

public struct ConfirmationDialogConfiguration

The configuration for customizing the confirmation dialog shown when cancelling a ListPickerDestination with unsaved selections.

  • The title text displayed in the confirmation dialog.

    Declaration

    Swift

    public let title: String
  • An optional closure called when the user taps cancel and there are unsaved changes, but the dialog is disabled. Invoked before the view is dismissed.

    Declaration

    Swift

    public var discardAction: (() -> Void)?
  • When true, the confirmation dialog is completely suppressed and tapping cancel always dismisses immediately, discarding changes.

    Declaration

    Swift

    public let isDialogDisabled: Bool
  • Creates a confirmation dialog configuration with custom actions.

    Declaration

    Swift

    public init(
        title: String = "Are you sure you want to discard your selections?".localizedFioriString(),
        isDialogDisabled: Bool = false,
        discardAction: (() -> Void)? = nil,
        @ViewBuilder actions: @escaping (_ dismiss: DismissAction) -> some View
    )

    Parameters

    title

    The dialog title. Defaults to the SDK’s localized “Are you sure you want to discard your selections?” string.

    isDialogDisabled

    When true, the dialog is never shown and cancel always dismisses immediately. Defaults to false.

    discardAction

    An optional closure invoked before dismiss when the dialog is disabled and the user taps cancel with unsaved changes.

    actions

    A @ViewBuilder closure that receives a dismiss action and returns the dialog’s action buttons. Use Button with roles like .destructive or .cancel to control styling.

  • Creates a confirmation dialog configuration with default action labels.

    Declaration

    Swift

    public init(
        title: String = "Are you sure you want to discard your selections?".localizedFioriString(),
        isDialogDisabled: Bool = false,
        discardAction: (() -> Void)? = nil
    )

    Parameters

    title

    The dialog title.

    isDialogDisabled

    When true, the dialog is never shown.

    discardAction

    An optional closure invoked before dismiss when the dialog is disabled and the user taps cancel with unsaved changes.

  • A convenience configuration that disables the confirmation dialog entirely.

    Declaration

    Swift

    public static let disabled: ConfirmationDialogConfiguration