ui5-webcomponents icon indicating copy to clipboard operation
ui5-webcomponents copied to clipboard

ui5-textarea: refactor textarea to sanitize special characters only on form submit

Open nikoletavnv opened this issue 1 year ago • 0 comments

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

  1. Open https://sap.github.io/ui5-webcomponents/nightly/packages/main/test/pages/TextArea.html
  2. Scroll to "Text Area: Growing"
  3. Write the following text: text "hello" &
  4. In Chrome dev tools remove Visibility:hidden of the "ui5-textarea-mirror" element
  5. 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.

nikoletavnv avatar Sep 14 '24 13:09 nikoletavnv