Friday, November 4, 2022
1 change · master
Resolved issues and error corrections
Clipboard fields now stay visible even when they have no content, so users can edit them instead of seeing a missing field. This improves form usability and prevents issues when empty text values are handled by the copy button.
Original PR description
**Issue:** When a copy clipboard field is empty, there is no way to edit it because the Field component is not shown. This issue can be reproduced using any type of copy clipboard field: -…
**Issue:** When a copy clipboard field is empty, there is no way to edit it because the Field component is not shown. This issue can be reproduced using any type of copy clipboard field: - CopyClipboardChar - CopyClipboardText - CopyClipboardURL Check the following video for illustration: https://youtu.be/CTzqJRtwqv0 **Solution:** This PR proposes a fix of *always* showing the copy clipboard field (together with the copy button) even if the content is empty. For illustration, check: https://youtu.be/jMM7zn_mFCU **Notable changes:** - The modified tests were using a wrong class name. But since they were asserting the "non-existence" of the copy button, they were working. - We are casting null text field to empty string (just like char field) so that we avoid crash (in dev mode) when passing a "boolean" as 'content' props to the 'CopyButton' component. This is asserted in the augmented test case where we also try to render an empty text field. TASK-ID: 2861388 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr