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] A Text field receives an unexpected value after changing the input type #5463

Open
JaneSjs opened this issue May 3, 2024 · 2 comments
Assignees
Labels
bug known issue user issue An issue or bug reported by users.

Comments

@JaneSjs
Copy link
Contributor

JaneSjs commented May 3, 2024

T18022 - Value not reset on change from text->color->text
https://surveyjs.answerdesk.io/internal/ticket/details/T18022


Please follow these steps to reproduce the issue: Change the input type from Text to Color and then back to Text. The #000000 value appears:

2024-05-03_20-09-05.mp4
@JaneSjs JaneSjs added bug user issue An issue or bug reported by users. labels May 3, 2024
@andrewtelnov
Copy link
Member

The problem is in knockout. question.koValue() returns an empty array and changing question.koValue() does't seems to change anything. The input continiues to show empty color value.

@JaneSjs JaneSjs changed the title A Text field receives an unexpected value after changing the input type [Knockout] A Text field receives an unexpected value after changing the input type May 6, 2024
@tsv2013
Copy link
Member

tsv2013 commented May 7, 2024

This is the default behavior for an input element. If you change the input type from color to text, the "#000000" color value is a valid string and it will be preserved as an input element value. It seems like framevorks like react, angular and others update value from a virtual dom, but knockoutjs doesn't do it.
We plan to get rid of survey-knockout in V2. On the other hand, this issue doesn't seem critical. That's why we won't fix it right now. I marked it as a known issue. We will keep it open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug known issue user issue An issue or bug reported by users.
Projects
None yet
Development

No branches or pull requests

3 participants