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

ComputedUpdater doesn't reevaluate the enabled property in an IAction object #6209

Open
RomanTsukanov opened this issue Dec 10, 2024 · 1 comment
Assignees

Comments

@RomanTsukanov
Copy link
Contributor

https://plnkr.co/edit/GC9hytDLvNTZsdEZ

In this example, a custom Clear Survey button is added to the toolbar. ComputedUpdater is used to activate the button when the survey is not empty. However, this doesn't work.

Steps to reproduce:

  1. Click the "Clear Survey" button. The button becomes disabled, which is fine.
  2. Add a new question to the survey.
    Expected result: The "Clear Survey" button becomes enabled again, since the survey contains an element.
    Current result: "Clear Survey" is disabled.
@tsv2013
Copy link
Member

tsv2013 commented Dec 19, 2024

The creator.survey.isEmpty actually checks pages lenght. ComputedUpdater right now doesn't react on array changes, it observes whole values assignment only. Unfortunately right now for such a cases we need to use another means, like survey.registerFunctionOnPropertyValueChanged("pages", () => {});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants