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

Knockout / jQuery: An expression validator doesn't update the validation message on value change #6790

Closed
FHourmy opened this issue Aug 24, 2023 · 3 comments
Assignees
Labels
bug user issue An issue or bug reported by users

Comments

@FHourmy
Copy link

FHourmy commented Aug 24, 2023

Are you requesting a feature, reporting a bug or asking a question?

Bug

Specify your

  • surveyjs platform (angular or react or jquery or knockout or vue): jquery
  • surveyjs version: 1.9.104

What is the current behavior?

Validator text containing an expression doesn't update properly on value change (version 1.9.104).
It used to work (tested on 1.8.71)

What is the expected behavior?

Validator text containing an expression should update when the value changes

How would you reproduce the current behavior (if this is a bug)?

reproduced on sandbox : https://codesandbox.io/s/winter-voice-vjcypc
enter a value, see the error text not updating

Provide the test code and the tested page URL (if applicable)

Tested page URL: https://codesandbox.io/s/winter-voice-vjcypc

@JaneSjs JaneSjs self-assigned this Aug 26, 2023
@JaneSjs JaneSjs added user issue An issue or bug reported by users need more info labels Aug 26, 2023
@JaneSjs
Copy link
Contributor

JaneSjs commented Aug 26, 2023

Hi @FHourmy,
Thank you for sharing the demo. I tested it on my end and confirms that expressions and validation work as expected. For instance, enter 30 within the first input field. The 'leftover' expression receives the 70 value and the error message appears as expected:
image

Now, enter 120 for the first field. The leftover expression is now set to -20 which is less than 0. The validation expression evaluates to true and the error message disappears.
image

Please let me know if you are expecting different behavior.

@FHourmy
Copy link
Author

FHourmy commented Aug 26, 2023

Hi @JaneSjs

For the Bug to happen here is the step by step :

  • initial state : correct value, no error
    image
  • you enter a wrong value => the error is triggered with the correct text
    image
  • you enter another wrong value => the text error is not updated

image

@andrewtelnov andrewtelnov assigned andrewtelnov and unassigned JaneSjs Aug 26, 2023
@andrewtelnov andrewtelnov changed the title Validator text containing an expression doesn't update properly on value change Knockout&jQuery: Validator text containing an expression doesn't update properly on value change Aug 26, 2023
andrewtelnov added a commit that referenced this issue Aug 26, 2023
@andrewtelnov
Copy link
Member

@FHourmy The issue has been fixed by this PR.

Thank you,
Andrew

@RomanTsukanov RomanTsukanov changed the title Knockout&jQuery: Validator text containing an expression doesn't update properly on value change Knockout / jQuery: An expression validator doesn't update the validation message on value change Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug user issue An issue or bug reported by users
Projects
None yet
Development

No branches or pull requests

3 participants