Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ericregnier opened this issue Jun 9, 2024 · 4 comments
Open

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

ericregnier opened this issue Jun 9, 2024 · 4 comments
Assignees
Labels
bug Something isn't working canvas Issue is related to a Canvas app custom component. Component: Dialog

Comments

@ericregnier
Copy link

ericregnier commented Jun 9, 2024

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 ericregnier added bug Something isn't working ⚠️ needs triage Has not been triaged by the team yet. labels Jun 9, 2024
@denise-msft denise-msft added this to the Creator Kit - June 2024 milestone Jun 12, 2024
@denise-msft
Copy link
Member

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 denise-msft self-assigned this Jun 13, 2024
@denise-msft denise-msft added canvas Issue is related to a Canvas app custom component. Component: Dialog and removed ⚠️ needs triage Has not been triaged by the team yet. labels Jun 13, 2024
@ericregnier
Copy link
Author

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?

@denise-msft
Copy link
Member

@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?

@ericregnier
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working canvas Issue is related to a Canvas app custom component. Component: Dialog
Projects
None yet
Development

No branches or pull requests

2 participants