summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--native/src/widget/text_input.rs16
1 files changed, 10 insertions, 6 deletions
diff --git a/native/src/widget/text_input.rs b/native/src/widget/text_input.rs
index b39c2ee8..68fd7dfb 100644
--- a/native/src/widget/text_input.rs
+++ b/native/src/widget/text_input.rs
@@ -214,14 +214,18 @@ where
match self.state.mouse.update(cursor_position) {
Interaction::DoubleClick(_) => {
- let end = self.state.cursor.end();
- self.state.cursor.select_range(
- self.value.previous_start_of_word(end),
- self.value.next_end_of_word(end),
- )
+ if self.is_secure {
+ self.state.cursor.select_all(&self.value);
+ } else {
+ let end = self.state.cursor.end();
+ self.state.cursor.select_range(
+ self.value.previous_start_of_word(end),
+ self.value.next_end_of_word(end),
+ );
+ }
}
Interaction::TripleClick(_) => {
- self.state.cursor.select_all(&self.value)
+ self.state.cursor.select_all(&self.value);
}
Interaction::Click(_) => {
if target > 0.0 {