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

Issue:
Editor widget does not handle '.'/'del' key on numeric keypad correctly.
### 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?

If you have an Editor widget, then the "decimal point" on the numeric keyboard acts as the "del" key whether numlock is on or off.

You can see this in the Editor example from https://github.com/iced-rs/iced/tree/master/examples/editor.

Run:  cargo run --package=editor and type anywhere using the numeric keypad to see this behaviour. This also occurs in my application.

### What is the expected behavior?

The "decimal point" key on the numeric keypad should enter a "." when numlock is on.

### Version

master

### Operating System

Linux

### Do you have any log output?

_No response_


Discussion / hints:
Text_input does NOT show this behaviour. Tested with https://github.com/iced-rs/iced/tree/master/examples/todos

Fix patch:
diff --git a/widget/src/text_editor.rs b/widget/src/text_editor.rs
index 5b565c3966..1df97962a2 100644
--- a/widget/src/text_editor.rs
+++ b/widget/src/text_editor.rs
@@ -981,7 +981,9 @@ impl<Message> Binding<Message> {
             keyboard::Key::Named(key::Named::Backspace) => {
                 Some(Self::Backspace)
             }
-            keyboard::Key::Named(key::Named::Delete) => Some(Self::Delete),
+            keyboard::Key::Named(key::Named::Delete) if text.is_none() => {
+                Some(Self::Delete)
+            }
             keyboard::Key::Named(key::Named::Escape) => Some(Self::Unfocus),
             keyboard::Key::Character("c") if modifiers.command() => {
                 Some(Self::Copy)


Test patch: