Copy Paste bug fixed
This commit is contained in:
parent
10cbed6eef
commit
35fd7dabbb
4 changed files with 7 additions and 3 deletions
|
|
@ -119,6 +119,7 @@ export default function ParameterComponent({
|
|||
) : (
|
||||
<InputComponent
|
||||
disabled={disabled}
|
||||
disableCopyPaste={true}
|
||||
password={data.node.template[name].password ?? false}
|
||||
value={data.node.template[name].value ?? ""}
|
||||
onChange={(t) => {
|
||||
|
|
|
|||
|
|
@ -6,11 +6,13 @@ import { TabsContext } from "../../contexts/tabsContext";
|
|||
export default function InputComponent({
|
||||
value,
|
||||
onChange,
|
||||
disableCopyPaste = false,
|
||||
disabled,
|
||||
password,
|
||||
}: InputComponentType) {
|
||||
const [myValue, setMyValue] = useState(value ?? "");
|
||||
const [pwdVisible, setPwdVisible] = useState(false);
|
||||
const {setDisableCopyPaste} = useContext(TabsContext);
|
||||
useEffect(() => {
|
||||
if (disabled) {
|
||||
setMyValue("");
|
||||
|
|
@ -27,6 +29,8 @@ export default function InputComponent({
|
|||
>
|
||||
<input
|
||||
value={myValue}
|
||||
onFocus={() => {if(disableCopyPaste) setDisableCopyPaste(true)}}
|
||||
onBlur={() => {if(disableCopyPaste) setDisableCopyPaste(false)}}
|
||||
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" : "",
|
||||
|
|
|
|||
|
|
@ -317,10 +317,8 @@ export default function FlowPage({ flow }: { flow: FlowType }) {
|
|||
onPaneClick={() => {
|
||||
setDisableCopyPaste(false);
|
||||
}}
|
||||
onNodeClick={() => {
|
||||
setDisableCopyPaste(true);
|
||||
}}
|
||||
onPaneMouseLeave={() => {
|
||||
console.log("saiu o mouse")
|
||||
setDisableCopyPaste(true);
|
||||
}}
|
||||
onNodesChange={onNodesChange}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ export type InputComponentType = {
|
|||
disabled?: boolean;
|
||||
onChange: (value: string) => void;
|
||||
password: boolean;
|
||||
disableCopyPaste?: boolean;
|
||||
};
|
||||
export type ToggleComponentType = {
|
||||
enabled: boolean;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue