Suggestion inserted in wrong place when accepting autocomplete inside empty if block

When accepting an autocomplete suggestion inside an empty if statement, Cursor places the text before the if block instead of inside the parentheses, breaking the code structure.

Here’s a video (GIF) of the bug happening:
Animação

To reproduce:

  1. Start writing React’s reducer function in TypeScript.
  2. Type if (|) where | is the cursor.
  3. Accept the autocomplete suggestion (e.g., action.type === "ADD_NEW_CYCLE") by pressing Tab. (Any other suggestion will do the same
  4. Observe that the suggestion is inserted before the if, not inside the parentheses breaking the syntax.

Expected result:
The suggestion should appear inside the parentheses:

if (action.type === "ADD_NEW_CYCLE")