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

TextArea: Cannot read properties of null (reading 'replace') #6472

Closed
C3ntraX opened this issue Feb 13, 2023 · 3 comments
Closed

TextArea: Cannot read properties of null (reading 'replace') #6472

C3ntraX opened this issue Feb 13, 2023 · 3 comments

Comments

@C3ntraX
Copy link

C3ntraX commented Feb 13, 2023

Describe the bug
If you reset the textarea with the value null, then you'll get the error: Cannot read properties of null (reading 'replace')

Isolated Example
https://codesandbox.io/s/silly-sid-9ut2y7?file=/src/App.js

To Reproduce
Steps to reproduce the behavior:

  1. Go to the sandbox
  2. Click on reset
  3. See error in console

Expected behavior
Its important, that the value null is valid, because if you are using librarys that resets the values, then there be shouldn't thown an error.
My library is Formik, a very popular library

Screenshots
If applicable, add screenshots to help explain your problem.

UI5 Web Components for React Information
@ui5/webcomponents version:
@ui5/webcomponents-react version:
Operating System:
Browser:

Additional context
Add any other context about the problem here.

@s-todorova
Copy link
Contributor

Hello @C3ntraX ,

As you can see in the documentation here https://sap.github.io/ui5-webcomponents/main/playground/components/TextArea/,
the "value" property only accepts "string" and has a default value of empty string. Therefore, what you are trying to achieve is not possible by intention.

Best regards,
Siyana

@C3ntraX
Copy link
Author

C3ntraX commented Feb 13, 2023

Its important, that the value null is valid, because if you are using librarys that resets the values, then there be shouldn't thown an error.
My library is Formik, a very popular library.

Therefore your solution causes the library to throw errors because its not API Standard

@C3ntraX
Copy link
Author

C3ntraX commented Feb 13, 2023

@s-todorova

You you pls discuss this intern? Because other inputs like the Input accepts null.

@Lukas742
This is an bug with the library Formik, which sets the value to null. In your example for React this could be an error case too. Althought its not used currently.

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

No branches or pull requests

2 participants