fix: text input jumps to the end of the text after writing one letter (#3090)
Fixed not being able to write in the middle of the component
This commit is contained in:
parent
1336ae0772
commit
6a1f1857e4
1 changed files with 108 additions and 102 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import { TEXT_FIELD_TYPES } from "@/CustomNodes/GenericNode/components/parameterComponent/constants";
|
||||
import { handleOnNewValueType } from "@/CustomNodes/hooks/use-handle-new-value";
|
||||
import { APIClassType, InputFieldType } from "@/types/api";
|
||||
import { useMemo } from "react";
|
||||
import CodeAreaComponent from "../codeAreaComponent";
|
||||
import DictComponent from "../dictComponent";
|
||||
import FloatComponent from "../floatComponent";
|
||||
|
|
@ -44,7 +45,8 @@ export function ParameterRenderComponent({
|
|||
templateData.name
|
||||
).toLowerCase();
|
||||
|
||||
return (
|
||||
return useMemo(
|
||||
() => (
|
||||
<RefreshParameterComponent
|
||||
templateData={templateData}
|
||||
disabled={disabled}
|
||||
|
|
@ -68,7 +70,9 @@ export function ParameterRenderComponent({
|
|||
<DictComponent
|
||||
disabled={disabled}
|
||||
editNode={editNode}
|
||||
value={(templateValue || "").toString() === "{}" ? {} : templateValue}
|
||||
value={
|
||||
(templateValue || "").toString() === "{}" ? {} : templateValue
|
||||
}
|
||||
onChange={onChange}
|
||||
id={`dict_${id}`}
|
||||
/>
|
||||
|
|
@ -146,5 +150,7 @@ export function ParameterRenderComponent({
|
|||
String(templateValue)
|
||||
)}
|
||||
</RefreshParameterComponent>
|
||||
),
|
||||
[templateData, disabled, nodeId, editNode, nodeClass, name, templateValue],
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue