[BUG]: Dialog control doesn't re-evaluate the Button property
Description The dialog control doesn't support dynamic buttons. The Button property is only evaluated once and cannot set some logic (i.e. condition).
To Reproduce Example steps to reproduce the behavior:
-
Assuming there's a canvas app with containing dialog control
-
Set the Buttons property to:
If(IsConfirmationDialog, Table({ Label: "Cancel", ButtonType:'Microsoft.CoreControls.Button.ButtonType'.Standard } , { Label: "Confirm", ButtonType:'Microsoft.CoreControls.Button.ButtonType'.Primary }) , Table({ Label: "Ok", ButtonType:'Microsoft.CoreControls.Button.ButtonType'.Primary }) ) -
Have a dummy button that toggles the
IsConfirmationDialogvariable to true/false:UpdateContext({IsConfirmationDialog: true}) -
Runt he app, toggle the dummy button and open the dialog
Expected behavior
Confirm and Cancel buttons appear only when IsConfirmationDialog is true and Ok button when IsConfirmationDialog is false.
Actual behavior
It seems like the Buttons property is only evaluated once at runtime, and never again. Using the repro steps example,
If IsConfirmationDialog was false at runtime then only the Ok button will be visible and will never show Confirm/Cancel even when 'IsConfirmationDialog' was updated to true. And vice-versa, if IsConfirmationDialog was true at runtime, Confirm/Cancel buttons will also show.
AB#3514
Are you using the latest version of the Creator Kit (May)?
Note: If you are not, do not upgrade if this app is in production. See announcement for more details.
No, I didn't install the "20240529.1" version as recommended in the announcement. I still have the 20230727.2 version. Are you suggesting my exact issue is fixed in the latest versions?
Is the June 24 version release yet?
@ericregnie I was suggesting that the issue may have been fixed in the latest version.
If you are still seeing this issue, can you please upgrade to the latest version of the Creator Kit and validate if that fixes the issue?
@denise-msft just upgraded and tried. Still doesn't work, the buttons are not re-evaluated