Skip to content

fix: on wasm, track the size of the parent element instead of trying to time explicit layout calls#37

Open
ramezgerges wants to merge 2 commits intomainfrom
resize_lag_by_one_frame
Open

fix: on wasm, track the size of the parent element instead of trying to time explicit layout calls#37
ramezgerges wants to merge 2 commits intomainfrom
resize_lag_by_one_frame

Conversation

@ramezgerges
Copy link
Copy Markdown

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:

Other information ℹ️

Copilot AI review requested due to automatic review settings December 16, 2025 18:08
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 RefreshLayout JSImport 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.

Comment thread MonacoEditorComponent/ts-helpermethods/asyncCallbackHelpers.ts Outdated
Comment thread MonacoEditorComponent/ts-helpermethods/asyncCallbackHelpers.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings January 20, 2026 17:20
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Resizing native element in WASM is behind by a frame, leaving a gap

3 participants