Skip to content

Commit

Permalink
fix : Fix the issue of losing focus when editing code in the code edi…
Browse files Browse the repository at this point in the history
…tor window
  • Loading branch information
pojol committed Jul 3, 2023
1 parent 8d13a91 commit 84fe5ec
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions editor/src/pages/config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,9 @@ export default function Config() {
);
};

const onChange = React.useCallback((value:any, viewUpdate:any) => {
const onChange = (value:any, viewUpdate:any) => {
setState((state) => ({ ...state, globalPrefab: value }));
}, []);
}

const clickTheme = (e: any) => {
setState((state) => ({ ...state, theme: e }));
Expand Down
5 changes: 3 additions & 2 deletions editor/src/pages/edit/node/action.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import ThemeType from '@/constant/constant';
const { Search } = Input;

export default function ActionTab() {

const [state, setState] = useState({
nod: getDefaultNodeNotifyInfo(),
node_ty: "",
Expand Down Expand Up @@ -116,12 +117,12 @@ export default function ActionTab() {
dispatch(nodeRedraw())
};

const onChange = React.useCallback((value:any, viewUpdate:any) => {
const onChange = (value:any, viewUpdate:any) => {
setState({
...state,
code: value,
});
}, []);
}

const handleAliasChange = (event: any) => {
setState({
Expand Down
4 changes: 2 additions & 2 deletions editor/src/pages/prefab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@ const Prefab = (props: PrefabProps) => {
});
}

const onChange = React.useCallback((value:any, viewUpdate:any) => {
const onChange = (value:any, viewUpdate:any) => {
setCode(value)
}, []);
}


const uploadPrefab = (name: string, code: string) => {
Expand Down

0 comments on commit 84fe5ec

Please sign in to comment.