fix: variable dynamic refresh & space match (#2142)

* fix: variable dynamic refresh & space match

* fix variable picker filter
This commit is contained in:
heheer
2024-07-23 22:02:36 +08:00
committed by GitHub
parent f9d43ac009
commit dcaf972767
5 changed files with 19 additions and 16 deletions

View File

@@ -20,6 +20,7 @@ import { textToEditorState } from './utils';
import { MaxLengthPlugin } from './plugins/MaxLengthPlugin';
import { VariableLabelNode } from './plugins/VariableLabelPlugin/node';
import VariableLabelPlugin from './plugins/VariableLabelPlugin';
import { useDeepCompareEffect } from 'ahooks';
export default function Editor({
h = 200,
@@ -79,10 +80,10 @@ export default function Editor({
document.addEventListener('mouseup', handleMouseUp);
};
useEffect(() => {
useDeepCompareEffect(() => {
if (focus) return;
setKey(getNanoid(6));
}, [value, variables.length]);
}, [value, variables]);
return (
<Box position={'relative'} width={'full'} h={`${height}px`} cursor={'text'}>