diff options
author | 2025-02-03 01:30:41 +0100 | |
---|---|---|
committer | 2025-02-03 01:30:41 +0100 | |
commit | 3a35fd6249eeb324379d3a14b020ccc48ec16fb4 (patch) | |
tree | e7db03dadb660818082db2d0fc6180a9a1f2cfd0 /widget | |
parent | d28af5739bfaafa141dc8071a0c910e8693f3b3c (diff) | |
download | iced-3a35fd6249eeb324379d3a14b020ccc48ec16fb4.tar.gz iced-3a35fd6249eeb324379d3a14b020ccc48ec16fb4.tar.bz2 iced-3a35fd6249eeb324379d3a14b020ccc48ec16fb4.zip |
Clamp pre-edit inside viewport bounds
Diffstat (limited to 'widget')
-rw-r--r-- | widget/src/text_input.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/widget/src/text_input.rs b/widget/src/text_input.rs index 58bbc0d6..a1a1d3b5 100644 --- a/widget/src/text_input.rs +++ b/widget/src/text_input.rs @@ -413,8 +413,7 @@ where let secure_value = self.is_secure.then(|| value.secure()); let value = secure_value.as_ref().unwrap_or(value); - let mut children_layout = layout.children(); - let text_bounds = children_layout.next().unwrap().bounds(); + let text_bounds = layout.children().next().unwrap().bounds(); let caret_index = match state.cursor.state(value) { cursor::State::Index(position) => position, @@ -435,7 +434,7 @@ where + alignment_offset; InputMethod::Open { - position: Point::new(x, text_bounds.y), + position: Point::new(x, text_bounds.y + text_bounds.height), purpose: if self.is_secure { input_method::Purpose::Secure } else { |