A custom WrapIfAdditionalTemplate takes its key value from keyName
Detect
- In your code: a custom
WrapIfAdditionalTemplatewhose key input useslabelas itsdefaultValue. - On the rendered page: a
deprecatedadditional property keyedfooshowsfoo (deprecated)in its key input and renames itself to that string on blur, or a key with aui:titleshows 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: