[Windows] Fix for FlowDirection="RightToLeft" causes mirrored content in WebView and HybridWebView#30709
Conversation
|
Hey there @@HarishwaranVijayakumar! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a Windows-specific issue where setting FlowDirection="RightToLeft" causes web content to appear mirrored in WebView and HybridWebView controls. The fix prevents the underlying WebView2 control from inheriting the flow direction setting, ensuring content displays correctly while maintaining proper RTL behavior for the container.
Key Changes:
- Added Windows-specific FlowDirection mapping overrides for both WebView and HybridWebView handlers
- Implemented no-op MapFlowDirection methods that prevent base ViewHandler behavior from affecting WebView2
- Added comprehensive UI test to validate the fix
Reviewed Changes
Copilot reviewed 6 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| WebViewHandler.cs | Added Windows-specific FlowDirection property mapping |
| WebViewHandler.Windows.cs | Implemented no-op MapFlowDirection override to prevent content mirroring |
| HybridWebViewHandler.cs | Added Windows-specific FlowDirection property mapping |
| HybridWebViewHandler.Windows.cs | Implemented no-op MapFlowDirection override for HybridWebView |
| Issue30575.cs (TestCases.Shared.Tests) | Added UI test to verify WebView content is not mirrored with RTL flow direction |
| Issue30575.cs (TestCases.HostApp) | Created test page demonstrating WebView with RTL flow direction |
jfversluis
left a comment
There was a problem hiding this comment.
See Copilot comment about the 3 second timeout.
Also, should BlazorWebView be included in this?
|
Yes, BlazorWebView is included too, since the issue happens there as well. |
|
@HarishwaranVijayakumar but I don't see any changes to BlazorWebView related files. Is that not needed? |
|
@jfversluis, I have committed the changes for BlazorWebView. |
) Fix updated Revert "Prevent FlowDirection from affecting WebView2 content on Windows" This reverts commit 406b01c. Reapply "Prevent FlowDirection from affecting WebView2 content on Windows" This reverts commit 355cfe2. Added TestCase Testcase Modified Revert "Fix updated" This reverts commit 78ac95e. Added comment Add fix for BlazorWebView
Issue Details
Description of Change
Issues Fixed
Fixes #30575
Tested the behaviour in the following platforms
Output