Skip to content

Commit da521d5

Browse files
authored
Fix del/dup/paste on read only diagrams (#848)
1 parent 7d58ea2 commit da521d5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/components/EditorHeader/ControlPanel.jsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ export default function ControlPanel({
622622
}
623623
};
624624
const del = () => {
625-
if (layout.readonly) {
625+
if (layout.readOnly) {
626626
return;
627627
}
628628
switch (selectedElement.element) {
@@ -640,7 +640,7 @@ export default function ControlPanel({
640640
}
641641
};
642642
const duplicate = () => {
643-
if (layout.readonly) {
643+
if (layout.readOnly) {
644644
return;
645645
}
646646
switch (selectedElement.element) {
@@ -700,7 +700,7 @@ export default function ControlPanel({
700700
}
701701
};
702702
const paste = () => {
703-
if (layout.readonly) {
703+
if (layout.readOnly) {
704704
return;
705705
}
706706
navigator.clipboard.readText().then((text) => {
@@ -738,7 +738,7 @@ export default function ControlPanel({
738738
});
739739
};
740740
const cut = () => {
741-
if (layout.readonly) {
741+
if (layout.readOnly) {
742742
return;
743743
}
744744
copy();
@@ -1991,7 +1991,7 @@ export default function ControlPanel({
19911991
</Dropdown>
19921992
);
19931993
}
1994-
if (menu[category][item].warning) {
1994+
if (menu[category][item].warning && !menu[category][item].disabled) {
19951995
return (
19961996
<Popconfirm
19971997
key={index}

0 commit comments

Comments
 (0)