Skip to content

Commit 9910768

Browse files
committed
improve comment
1 parent 361a2e6 commit 9910768

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

packages/ui/src/features/variable-input/components/VariableInput.tsx

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -458,13 +458,22 @@ const VariableInput = React.forwardRef<HTMLElement, VariableInputProps>((props,
458458
setShowSelector(false);
459459
setQuery('');
460460

461-
// if (editableRef.current && unmanagedStateRef.current.variableSelectionState) {
462-
// const node = editableRef.current.childNodes[unmanagedStateRef.current.variableSelectionState.queryStartSelection.partIndex];
461+
if (!unmanagedStateRef.current.variableSelectionState)
462+
return;
463+
464+
// const { queryStartSelection } = unmanagedStateRef.current.variableSelectionState;
463465

464-
// if (node && node.nodeName == 'SPAN') {
466+
// if (editableRef.current) {
467+
// const node = editableRef.current.childNodes[queryStartSelection.partIndex];
468+
469+
// if (node && node.nodeName === 'SPAN') {
465470
// const span = node as HTMLSpanElement;
466471

467-
// span.innerText = span.innerText.substring(0, unmanagedStateRef.current.variableSelectionState.queryStartSelection.offset);
472+
// console.log('span', span.innerText);
473+
// console.log('queryStartSelection.offset', queryStartSelection.offset);
474+
// console.log('queryStartSelection.partIndex', queryStartSelection.partIndex);
475+
476+
// span.innerText = span.innerText.substring(0, queryStartSelection.offset);
468477
// }
469478
// }
470479

0 commit comments

Comments
 (0)