Skip to main content
Version: Current (v7.0.0-beta.3)

A custom WrapIfAdditionalTemplate takes its key value from keyName

Detect​

  • In your code: a custom WrapIfAdditionalTemplate whose key input uses label as its defaultValue.
  • On the rendered page: a deprecated additional property keyed foo shows foo (deprecated) in its key input and renames itself to that string on blur, or a key with a ui:title shows the title.

Change​

Take the key input's value from keyName, and keep label for the input's own label:

const keyLabel = translateString(TranslatableString.KeyLabel, [label]);
-<input type='text' id={additionalKeyId(id)} onBlur={onKeyRenameBlur} defaultValue={label} />;
+<input type='text' id={additionalKeyId(id)} onBlur={onKeyRenameBlur} defaultValue={keyName} />;

Verify​

  • The key input shows the real key, and blurring it without edits leaves the key unchanged.

Also read: