fix: on wasm, track the size of the parent element instead of trying to time explicit layout calls#37
fix: on wasm, track the size of the parent element instead of trying to time explicit layout calls#37ramezgerges wants to merge 2 commits intomainfrom
Conversation
…to time explicit layout calls
There was a problem hiding this comment.
Pull request overview
This PR fixes an issue with Monaco Editor sizing on WASM by replacing manual layout refresh calls with automatic parent element size tracking using ResizeObserver. Instead of relying on explicit LayoutUpdated events and window resize listeners, the editor now observes its parent element directly and adjusts layout automatically when size changes occur.
Key Changes:
- Replaced window resize listener with ResizeObserver for more reliable size tracking
- Removed C# LayoutUpdated event handler that triggered manual layout refreshes
- Removed the
RefreshLayoutJSImport method and its manual invocations
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| MonacoEditorComponent/ts-helpermethods/asyncCallbackHelpers.ts | Replaced window resize listener with ResizeObserver to track parent element size changes; removed manual layout calls |
| MonacoEditorComponent/CodeEditor/CodeEditorPresenter.wasm.cs | Removed LayoutUpdated event handler, RefreshLayout JSImport method, and manual layout refresh calls |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
GitHub Issue: closes unoplatform/uno#22144
PR Type:
What is the current behavior? 🤔
What is the new behavior? 🚀
PR Checklist ✅
Please check if your PR fulfills the following requirements:
Screenshots Compare Test Runresults.Other information ℹ️