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

Issue:
Input widget should not copy or cut if secure
### 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?

Pressing <kbd>comannd</kbd> + <kbd>c</kbd> /  <kbd>comannd</kbd> + <kbd>x</kbd> copied / cut the content of a text_input if in secure mode

### What is the expected behavior?

secure inputs should not allow copy / cut of the input

### Version

crates.io release

### Operating System

Windows

### Do you have any log output?

_No response_


Discussion / hints:

Fix patch:
diff --git a/widget/src/text_input.rs b/widget/src/text_input.rs
index 8cfb0408eb..a814df786e 100644
--- a/widget/src/text_input.rs
+++ b/widget/src/text_input.rs
@@ -712,7 +712,8 @@ where
 
                     match key.as_ref() {
                         keyboard::Key::Character("c")
-                            if state.keyboard_modifiers.command() =>
+                            if state.keyboard_modifiers.command()
+                                && !self.is_secure =>
                         {
                             if let Some((start, end)) =
                                 state.cursor.selection(&self.value)
@@ -726,7 +727,8 @@ where
                             return event::Status::Captured;
                         }
                         keyboard::Key::Character("x")
-                            if state.keyboard_modifiers.command() =>
+                            if state.keyboard_modifiers.command()
+                                && !self.is_secure =>
                         {
                             if let Some((start, end)) =
                                 state.cursor.selection(&self.value)


Test patch: