Skip to content

Commit 038c6c1

Browse files
committed
minor fix to copy element feature
1 parent 58abaff commit 038c6c1

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

view/mainView.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,16 @@ document.addEventListener("keydown", function (e) {
5252
}
5353
} else if (e.ctrlKey && (e.key === "c" || e.key === "C")) {
5454
const copyButton = document.getElementById("copy-button");
55-
if (copyButton.disabled === false) {
55+
56+
//if an input text field is on focus, disable element copy in favor of text copy
57+
const elementOnFocus = document.querySelector(":focus");
58+
const inputElements = [
59+
...document.querySelectorAll(".update-element-value-input"),
60+
];
61+
if (
62+
copyButton.disabled === false &&
63+
!inputElements.includes(elementOnFocus)
64+
) {
5665
copyExpandedOrSelectedElements();
5766
}
5867
} else if (e.ctrlKey && (e.key === "z" || e.key === "Z")) {

0 commit comments

Comments
 (0)