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] An exception is thrown when using Ctrl+Z to reset a calculated field name to its initial value #4889

Closed
JaneSjs opened this issue Nov 14, 2023 · 0 comments · Fixed by #4902
Assignees
Labels
Milestone

Comments

@JaneSjs
Copy link
Contributor

JaneSjs commented Nov 14, 2023

To reproduce the issue, run a free demo and follow these steps:

  • Create a calculated field.
  • Change its name
  • Press Ctrl+Z to undo the operation and reset the name to its initial value
  • You'll see that the calculated field is removed instead
2023-11-14_11-50-14.mp4

The following exception appears in a browser console:

Uncaught TypeError: Cannot read properties of undefined (reading 'value')
    at t.addRowCore (survey.core.min.js:6:497135)
    at t.addRow (survey.core.min.js:6:495929)
    at t.addRowUI (survey.core.min.js:6:495454)
    at t.addRow (survey-knockout-ui.min.js:6:164855)
    at t.koAddRowClick (survey-knockout-ui.min.js:6:161244)
    at HTMLButtonElement.<anonymous> (knockout.js:445:350)
@JaneSjs JaneSjs added the bug label Nov 14, 2023
@JaneSjs JaneSjs changed the title The 'Cannot read properties of undefined (reading 'value')' exception is thrown when using the Ctrl+Z to reset a calculated field name to the initial value [Knockout] The 'Cannot read properties of undefined (reading 'value')' exception is thrown when using the Ctrl+Z to reset a calculated field name to the initial value Nov 14, 2023
tsv2013 pushed a commit that referenced this issue Nov 17, 2023
…e')' exception is thrown when using the Ctrl+Z to reset a calculated field name to the initial value
tsv2013 pushed a commit to surveyjs/survey-library that referenced this issue Nov 20, 2023
…f undefined (reading 'value')' exception is thrown when using the Ctrl+Z to reset a calculated field name to the initial value
tsv2013 pushed a commit that referenced this issue Nov 20, 2023
…e')' exception is thrown when using the Ctrl+Z to reset a calculated field name to the initial value
novikov82 pushed a commit to surveyjs/survey-library that referenced this issue Nov 20, 2023
…f undefined (reading 'value')' exception is thrown when using the Ctrl+Z to reset a calculated field name to the initial value (#7386)

Co-authored-by: tsv2013 <[email protected]>
tsv2013 added a commit that referenced this issue Nov 21, 2023
…e')' exception is thrown when using the Ctrl+Z to reset a calculated field name to the initial value (#4902)

* Fixed #4889 - The 'Cannot read properties of undefined (reading 'value')' exception is thrown when using the Ctrl+Z to reset a calculated field name to the initial value

* Fixed #4889 - The 'Cannot read properties of undefined (reading 'value')' exception is thrown when using the Ctrl+Z to reset a calculated field name to the initial value

* Fixed linter

* Fixed u-tests

---------

Co-authored-by: tsv2013 <[email protected]>
@RomanTsukanov RomanTsukanov changed the title [Knockout] The 'Cannot read properties of undefined (reading 'value')' exception is thrown when using the Ctrl+Z to reset a calculated field name to the initial value [Knockout] An exception is thrown when using Ctrl+Z to reset a calculated field name to its initial value Nov 21, 2023
@OlgaLarina OlgaLarina added this to the v1.9.118 milestone Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment