Repository: iced-rs/iced (language: rust)

Issue:
Delete key not working in text editor
### Is your issue REALLY a bug?

- [X] My issue is indeed a bug!
- [X] I am not crazy! I will not fill out this form just to ask a question or request a feature. Pinky promise.

### Is there an existing issue for this?

- [X] I have searched the existing issues.

### Is this issue related to iced?

- [X] My hardware is compatible and my graphics drivers are up-to-date.

### What happened?

The delete key is not deleting characters in the text editor widget. The corresponding action is also not being printed when I log all actions and press the delete key. The delete works fine in the text input widget.

### What is the expected behavior?

The next character after the cursor should be deleted when the delete key is pressed.

### Version

master

### Operating System

Linux

### Do you have any log output?

_No response_


Discussion / hints:

Fix patch:
diff --git a/widget/src/text_editor.rs b/widget/src/text_editor.rs
index a93224743f..3676d02f08 100644
--- a/widget/src/text_editor.rs
+++ b/widget/src/text_editor.rs
@@ -1045,7 +1045,9 @@ impl<Message> Binding<Message> {
             keyboard::Key::Named(key::Named::Backspace) => {
                 Some(Self::Backspace)
             }
-            keyboard::Key::Named(key::Named::Delete) if text.is_none() => {
+            keyboard::Key::Named(key::Named::Delete)
+                if text.is_none() || text.as_deref() == Some("\u{7f}") =>
+            {
                 Some(Self::Delete)
             }
             keyboard::Key::Named(key::Named::Escape) => Some(Self::Unfocus),


Test patch: