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

Add isExecutingOnNavigation property into trigger fix #9483 #9488

Merged
merged 2 commits into from
Feb 24, 2025

Conversation

andrewtelnov
Copy link
Member

No description provided.

Copy link
Contributor

@SamMousa SamMousa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it'll work for sure, but do we really need the separation between isOnNavigation and isOnNextPage?

From my perspective there's just 2 scenarios, the onValueChange and onNavigation executions...

I'm worried that adding so many variables makes it hard to maintain.

Also, while you're changing checkTriggers, I think you could add more strict typing :-)

Regardless, if you prefer it like this, this will solve my problem as far as i can tell! <3

@@ -4112,6 +4112,9 @@ export class SurveyModel extends SurveyElementCore
const questions = this.getAllQuestions(true);
const index = questions.indexOf(q);
if(index < 0 || index === questions.length - 1) return false;
const key: any = {};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const key: any = {};
const key: Record<string, unknown> = {};

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is better to be consistent. We use to have any for these scenarios.

Thank you,
Andrew

@andrewtelnov
Copy link
Member Author

andrewtelnov commented Feb 20, 2025

I think it'll work for sure, but do we really need the separation between isOnNavigation and isOnNextPage?

From my perspective there's just 2 scenarios, the onValueChange and onNavigation executions...

I can't remove isExecutingOnNextPage. It could break somebodies code. You can use isExecutingOnNavigation. It will be true for both scenarios.

Thank you,
Andrew

@SamMousa
Copy link
Contributor

SamMousa commented Feb 20, 2025

I can't remove isExecutingOnNextPage. It could break somebodies code. You can use isExecutingOnNavigation. It will be true for both scenarios.

Fully agree, what about deprecating it? So it can be removed some time in the future?

Edit: internally you could even make it a read only property that just mirrors the value of isExeuctingOnNavigation thereby making the backwards compatibility something only appearing inside the trigger, not outside.

@andrewtelnov
Copy link
Member Author

I can't remove isExecutingOnNextPage. It could break somebodies code. You can use isExecutingOnNavigation. It will be true for both scenarios.

Fully agree, what about deprecating it? So it can be removed some time in the future?

Yes, we can do it in the future.

Thank you,
Andrew

@andrewtelnov
Copy link
Member Author

@SamMousa I stopped using isExecutingOnNextPage property.

Thank you,
Andrew

@tsv2013 tsv2013 merged commit 3aca390 into master Feb 24, 2025
5 checks passed
@tsv2013 tsv2013 deleted the bug/9483-trigger-onnavigation-prop branch February 24, 2025 08:29
andrewtelnov added a commit that referenced this pull request Feb 24, 2025
* Add isExecutingOnNavigation property into trigger fix #9483

* Make isExecutingOnNextPage un-needed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants