ui5-webcomponents
ui5-webcomponents copied to clipboard
ui5-textarea: refactor textarea to sanitize special characters only on form submit
Bug Description
Currently the textarea uses a mirror div element that is invisible and should match the visible textarea completely. The text in the mirror div is sanitized and special characters are escaped during the before rendering phase. This leas to difference in the text length in the visible textarea and the mirror element. The difference causes problems during textarea growing. We can try to sanitize the mirror div content only when submitting a form.
Affected Component
ui5-textarea
Expected Behaviour
The text in the visible textarea and the hidden mirror div should match exactly
Isolated Example
No response
Steps to Reproduce
- Open https://sap.github.io/ui5-webcomponents/nightly/packages/main/test/pages/TextArea.html
- Scroll to "Text Area: Growing"
- Write the following text: text "hello" &
- In Chrome dev tools remove Visibility:hidden of the "ui5-textarea-mirror" element
- See that the textarea text and the mirror element content do not match ...
Log Output, Stack Trace or Screenshots
No response
Priority
None
UI5 Web Components Version
2.0.1
Browser
Chrome
Operating System
No response
Additional Context
No response
Organization
No response
Declaration
- [X] I’m not disclosing any internal or sensitive information.