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

OriginalValue has invalid initial value #3509

Closed
edloidas opened this issue Mar 28, 2024 · 0 comments · Fixed by #3510
Closed

OriginalValue has invalid initial value #3509

edloidas opened this issue Mar 28, 2024 · 0 comments · Fixed by #3510
Assignees
Labels
Bug Something isn't working

Comments

@edloidas
Copy link
Member

When the FormInputEl is initialized,originalValue is assigned to undefined if not set during initialization. But if we call resetBaseValues() it will be assigned to "" (if input is empty), because this.getValue() returns "" for empty input.
But if we check the dirty state, originalValue will be wrapped in string object and return "undefined" and later compared to empty input value "". This is not correct at all.
Initial value for originalValue must be an empty string, and the value itself must not be wrapped in String, as it either a string, or null/undefined by default.

@edloidas edloidas added the Bug Something isn't working label Mar 28, 2024
@edloidas edloidas self-assigned this Mar 28, 2024
@edloidas edloidas changed the title OriginalValue has ivalid initial value OriginalValue has invalid initial value Mar 28, 2024
@edloidas edloidas linked a pull request Mar 28, 2024 that will close this issue
edloidas added a commit that referenced this issue Apr 2, 2024
Restored `oldValue` to default empty string.
alansemenov pushed a commit that referenced this issue Apr 2, 2024
Restored `oldValue` to default empty string.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant