You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Imagine a scenario where the passed in prop is true but the editor was already focused. We can see that we'd still end up calling the core hastTextFocus api which can lead to low level dom queries and potential layout thrashing.
This can be optimized by checking prevProps, following a similar pattern:
To update editor's focus state, we check if the passed in prop is true and if the editor is not already focused:
nteract/packages/monaco-editor/src/MonacoEditor.tsx
Lines 382 to 385 in d2088d0
Imagine a scenario where the passed in prop is true but the editor was already focused. We can see that we'd still end up calling the core
hastTextFocus
api which can lead to low level dom queries and potential layout thrashing.This can be optimized by checking
prevProps
, following a similar pattern:nteract/packages/monaco-editor/src/MonacoEditor.tsx
Lines 317 to 321 in d2088d0
The text was updated successfully, but these errors were encountered: