[Bug] I cannot reference another cell after formula fist argument if add space or newline
Before you submit this issue, have you checked the following
- Is this really a problem?
- I have searched the Github Issues for similar issues, but did not find anything.
Affected packages and versions
univer 0.25.1
Reproduction link
Let say i want to write =SUM(A1,A2).
First i write =SUM(, then i select cell A1, write ,, select cell A2, write ).
It works, no problem.
But, if i write =SUM(, select cell A1, write ,, add \s (whitespace), i can no longer select A2 by click. I must write it manually. The result of =SUM(A1+ A2) is still calculated correctly though.
The problem also exist if we use \n (newline). Lets say if want to write long IF formula. Example:
=IF(
A1>=1,
B1,
B2
)
After i write =IF( and add newline, i cannot directly select A1 by click. I need to manually write A
1 using keyboard to make it work.
Expected behavior
When writing or editing a formula, adding a whitespace (\s) or a newline (\n) after a comma or parenthesis should not break cell selection mode.Users should still be able to click on any cell (e.g., A2 or A1) to automatically insert its reference into the formula bar, regardless of whether the cursor immediately follows a space or a line break.
Actual behavior
Adding a whitespace (\s) or a newline (\n) during formula composition disables the cell selection by click feature.Scenario 1 (Whitespace): Typing =SUM(, clicking A1, typing ,, and adding a space prevents the user from clicking A2. The cell reference must be typed manually, though the formula still calculates correctly if typed out.Scenario 2 (Newline): Typing =IF( and hitting Enter (newline) for a multi-line formula prevents the user from clicking A1 on the next line. The user is forced to manually type the coordinate via the keyboard.
System information
No response
Source: dream-num/univer