From bef1cc096c0e84139e1933b72ee04bd4c49f9512 Mon Sep 17 00:00:00 2001 From: Lucas Oliveira Date: Thu, 25 May 2023 19:56:42 -0300 Subject: [PATCH] Fixed Copy Paste issues by disabling it when the user clicks at the node --- .../src/components/floatComponent/index.tsx | 8 +------ .../src/components/inputComponent/index.tsx | 8 +------ .../components/inputListComponent/index.tsx | 7 ------- .../src/components/intComponent/index.tsx | 8 +------ .../src/modals/chatModal/chatInput/index.tsx | 8 ------- .../src/modals/codeAreaModal/index.tsx | 7 ------- src/frontend/src/modals/exportModal/index.tsx | 21 ++----------------- .../components/tabComponent/index.tsx | 6 +----- src/frontend/src/pages/FlowPage/index.tsx | 7 ++++++- 9 files changed, 12 insertions(+), 68 deletions(-) diff --git a/src/frontend/src/components/floatComponent/index.tsx b/src/frontend/src/components/floatComponent/index.tsx index c09f3b9e0..2752db43c 100644 --- a/src/frontend/src/components/floatComponent/index.tsx +++ b/src/frontend/src/components/floatComponent/index.tsx @@ -14,7 +14,6 @@ export default function FloatComponent({ onChange(""); } }, [disabled, onChange]); - const {setDisableCopyPaste} = useContext(TabsContext) return (
{ - setDisableCopyPaste(false) - }} - onFocus={() => { - setDisableCopyPaste(true) - }} + />
); diff --git a/src/frontend/src/components/inputComponent/index.tsx b/src/frontend/src/components/inputComponent/index.tsx index b4f52902d..648458f2b 100644 --- a/src/frontend/src/components/inputComponent/index.tsx +++ b/src/frontend/src/components/inputComponent/index.tsx @@ -11,7 +11,6 @@ export default function InputComponent({ }: InputComponentType) { const [myValue, setMyValue] = useState(value ?? ""); const [pwdVisible, setPwdVisible] = useState(false); - const {setDisableCopyPaste} = useContext(TabsContext) useEffect(() => { if (disabled) { setMyValue(""); @@ -28,12 +27,7 @@ export default function InputComponent({ > { - setDisableCopyPaste(false) - }} - onFocus={() => { - setDisableCopyPaste(true) - }} + className={classNames( "block w-full pr-12 form-input dark:bg-gray-900 dark:border-gray-600 rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm", disabled ? " bg-gray-200 dark:bg-gray-700" : "", diff --git a/src/frontend/src/components/inputListComponent/index.tsx b/src/frontend/src/components/inputListComponent/index.tsx index 57ddd7a4e..01f783ad6 100644 --- a/src/frontend/src/components/inputListComponent/index.tsx +++ b/src/frontend/src/components/inputListComponent/index.tsx @@ -17,7 +17,6 @@ export default function InputListComponent({ onChange([""]); } }, [disabled, onChange]); - const {setDisableCopyPaste} = useContext(TabsContext) return (
{ - setDisableCopyPaste(false) - }} - onFocus={() => { - setDisableCopyPaste(true) - }} /> {idx === inputList.length - 1 ? (
diff --git a/src/frontend/src/modals/chatModal/chatInput/index.tsx b/src/frontend/src/modals/chatModal/chatInput/index.tsx index 5cddb9c14..5a979499a 100644 --- a/src/frontend/src/modals/chatModal/chatInput/index.tsx +++ b/src/frontend/src/modals/chatModal/chatInput/index.tsx @@ -17,8 +17,6 @@ export default function ChatInput({ } }, [chatValue]); - const { setDisableCopyPaste } = useContext(TabsContext); - return (