Skip to content

Commit

Permalink
Avoid nested updates closing signature help. (#1058)
Browse files Browse the repository at this point in the history
Fixes issue observed on beta.
  • Loading branch information
microbit-matt-hillsdon authored Oct 29, 2022
1 parent 9153f8d commit 9d066cf
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/editor/codemirror/language-server/signatureHelp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,12 @@ export const signatureHelp = (
!(event.relatedTarget instanceof Element) ||
!event.relatedTarget.closest(".cm-signature-tooltip")
) {
view.dispatch({
effects: setSignatureHelpRequestPosition.of(-1),
});
// This can be called inside an update.
setTimeout(() => {
view.dispatch({
effects: setSignatureHelpRequestPosition.of(-1),
});
}, 0);
}
},
}),
Expand Down

0 comments on commit 9d066cf

Please sign in to comment.