Make copying an element list out its attributes instead of a useless id
Summary: When copying elements from the layout inspector its much more useful to copy all associated attributes rather than just the name and an implementation detail id. Reviewed By: jknoxville Differential Revision: D17727520 fbshipit-source-id: 8ac1828059cc10f7f9faf0bdc72eb3d57c881121
This commit is contained in:
committed by
Facebook Github Bot
parent
9bce894b71
commit
447e918607
@@ -238,7 +238,11 @@ class ElementsRow extends PureComponent<ElementsRowProps, ElementsRowState> {
|
||||
{
|
||||
label: 'Copy',
|
||||
click: () => {
|
||||
clipboard.writeText(props.element.name + ' id=' + props.element.id);
|
||||
const attrs = props.element.attributes.reduce(
|
||||
(acc, val) => acc + ` ${val.name}=${val.value}`,
|
||||
'',
|
||||
);
|
||||
clipboard.writeText(`${props.element.name}${attrs}`);
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user