powercat-creator-kit icon indicating copy to clipboard operation
powercat-creator-kit copied to clipboard

[BUG]: Dialog control doesn't re-evaluate the Button property

Open ericregnier opened this issue 1 year ago • 4 comments

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:

  1. Assuming there's a canvas app with containing dialog control

  2. 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 }) )

  3. Have a dummy button that toggles the IsConfirmationDialog variable to true/false: UpdateContext({IsConfirmationDialog: true})

  4. 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

ericregnier avatar Jun 09 '24 09:06 ericregnier

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.

denise-msft avatar Jun 13 '24 21:06 denise-msft

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?

ericregnier avatar Jul 08 '24 07:07 ericregnier

@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 avatar Aug 30 '24 01:08 denise-msft

@denise-msft just upgraded and tried. Still doesn't work, the buttons are not re-evaluated

ericregnier avatar Sep 03 '24 15:09 ericregnier