ui-kit icon indicating copy to clipboard operation
ui-kit copied to clipboard

Allow resetting all hidden RichTextInputs of a LocalizedRichTextInput

Open kark opened this issue 2 years ago • 0 comments

Describe the bug Currently, when the additional languages of the LocalizedRichTextInput are hidden, there is no method available to reset the hidden RichTextInputs.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://uikit.commercetools.com/?path=/story/components-inputs--localizedrichtextinput
  2. Click on Set initial value -> enter the initial values -> Click Reset
  3. Click on Show all languages
  4. Notice that the previously hidden RichTextInputs won't reset

Additional context Hiding languages removes the RichTextInputs from DOM, therefore the refs do not work.

Consider:

  • if hiding RichTextInputs by applying css styling that doesn't remove the RichTextInputs from DOM can solve this issue
  • replacing current resetting solution (based on useImperativeHandle hook) with another solution

kark avatar Oct 20 '23 10:10 kark