From 0c13943139295e892a69ca4ee889e7cd4bbbd831 Mon Sep 17 00:00:00 2001 From: Pritesh Nandgaonkar Date: Mon, 9 Dec 2019 05:08:38 -0800 Subject: [PATCH] Allow user to copy the row attributes in the layour inspector Summary: Allows user to copy the row attributes. Reviewed By: passy Differential Revision: D18811929 fbshipit-source-id: 62335a7c0b5f1557704c0d8d9ea258b4c7cbfdcf --- src/ui/components/elements-inspector/elements.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/ui/components/elements-inspector/elements.tsx b/src/ui/components/elements-inspector/elements.tsx index 06f5eda6c..32f596a95 100644 --- a/src/ui/components/elements-inspector/elements.tsx +++ b/src/ui/components/elements-inspector/elements.tsx @@ -240,7 +240,7 @@ class ElementsRow extends PureComponent { getContextMenu = (): Array => { const {props} = this; - const items: Array = [ + let items: Array = [ { type: 'separator', }, @@ -269,6 +269,16 @@ class ElementsRow extends PureComponent { }, }, ]; + items = items.concat( + props.element.attributes.map(o => { + return { + label: `Copy ${o.name}`, + click: () => { + clipboard.writeText(o.value); + }, + }; + }), + ); for (const extension of props.contextMenuExtensions) { items.push({