MultiLineTextInput widget persistently takes on rich formatting on a paste operation
- Dominant language
- Python
- Stars
- 5.4k
- Forks
- 827
- Avg merge
- 15h 39m
- Merged PRs (30d)
- 40
Description
### Describe the bug
When pasting rich-formatted text into a MultiLineTextInput widget, the widget takes on the rich formatting.
### Steps to reproduce
1. Launch a Toga application that includes a MultiLineTextInput widget. e.g., from the Toga repository, examples/multilinetextinput.
2. Copy rich-formatted text from another application, e.g., MS Word, TextEdit, a web browser.
3. Paste into the MultiLineTextInput widget.
4. Rich-formatting is preserved in the MultiLineTextInput widget. The formatting persists even when clearing the value (e.g., "clear" button in the Toga multilinetextinput example).
### Expected behavior
While rich formatting may be desirable in some situations, I'd expect the default behavior to be displaying only plain text, like a TextInput widget.
### Screenshots
**Before paste:**
**Rich text (TextEdit):**
**After paste:**
**After clear:**
### Environment
- Operating System:
- MacOS Sequoia 15.1
- Windows 11
- Others???
- Python version:
- 3.12.7
- Software versions:
- Toga: 0.4.8
### Logs
```
```
### Additional context
_No response_
Contributor guide
Research direction
Start with the MultiLineTextInput widget and the examples/multilinetextinput application to reproduce the paste and clear behavior. Trace the widget's platform-specific implementations and existing text-input tests, if present, to determine how rich text is handled on macOS and Windows. Done means pasted rich text displays as plain text by default and clearing the widget removes any residual formatting.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100