microsoft / microsoft/microsoft-ui-xaml

Table and image resize are broken in WinUI 3 RichEditBox

Open
#10,090 0 comments 2 reactions 0 assignees View on GitHub
area-Images area-TextBox bug needs-repro needs-triage
Dominant language
C++
Stars
8.4k
Forks
942
Avg merge
2d 7h
Merged PRs (30d)
105

Description

### Describe the bug

The RichEditBox allows to resize images and table rows/columns like the native RichEdit control, even if it doesn't display a resize cursor or adorner (as a side note, it would be nice if it did since it's been supported in WordPad for many years).
However, while they work individually, if you have both an image and a table in the RichEditBox content there are visual glitches, it seems the controls doesn't properly redraw itself (please see the GIF below). Selecting all via Ctrl+A seems partially fix this, but often it's impossible to remove the selection from a table or cell by clicking away from it.
This issue only occurs in WinUI 3, not in UWP/WinUI 2.

### Steps to reproduce the bug

I can't find a consistent way to reproduce this (sometimes images work, while for tables always occurs), but generally:
1. Paste an image or insert it using ITextRange.InsertImage()
2. Paste a table from Microsoft Word or another word processing software
3. Try to resize the image and a row or column, alterning between them

### Expected behavior

It should work properly as in UWP / WinUI 2.

### Screenshots

![Image](https://github.com/user-attachments/assets/09f1415b-b4b0-4a10-9857-9b7a06540cc0)

### NuGet package version

WinUI 3 - Windows App SDK 1.6.1: 1.6.240923002

### Windows version

Windows 11 (22H2): Build 22621

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue in a WinUI 3 RichEditBox using Windows App SDK 1.6.1: insert an image, paste a table from Word, and alternate resizing them. Compare the behavior with UWP/WinUI 2; it is done when image and row or column resizing redraw correctly and selection can be cleared by clicking away.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.