mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-23 17:08:34 +00:00
Fixed bug causing component definition to be copied on copying text
This commit is contained in:
parent
a32580f14b
commit
c70892ba80
1 changed files with 6 additions and 0 deletions
|
|
@ -240,6 +240,12 @@ const getSelectedText = () => {
|
|||
|
||||
// TODO: Move this function to componentSlice
|
||||
export const copyComponents = ({ isCut = false, isCloning = false }) => {
|
||||
const selectedText = window.getSelection()?.toString().trim();
|
||||
if (selectedText) {
|
||||
navigator.clipboard.writeText(selectedText);
|
||||
return;
|
||||
}
|
||||
|
||||
const selectedComponents = useStore.getState().getSelectedComponentsDefinition();
|
||||
if (selectedComponents.length < 1) return getSelectedText();
|
||||
const allComponents = useStore.getState().getCurrentPageComponents();
|
||||
|
|
|
|||
Loading…
Reference in a new issue