diff --git a/bin/darkwallet/src/app.rs b/bin/darkwallet/src/app.rs index 985b1e3f6..f7ba35f14 100644 --- a/bin/darkwallet/src/app.rs +++ b/bin/darkwallet/src/app.rs @@ -360,7 +360,7 @@ impl App { prop.set_null(0).unwrap(); prop.set_null(1).unwrap(); node.set_property_u32("z_index", 1).unwrap(); - node.set_property_bool("debug", true).unwrap(); + //node.set_property_bool("debug", true).unwrap(); drop(sg); let pimpl = EditBox::new( diff --git a/bin/darkwallet/src/ui/editbox.rs b/bin/darkwallet/src/ui/editbox.rs index 528a79782..a2be204a0 100644 --- a/bin/darkwallet/src/ui/editbox.rs +++ b/bin/darkwallet/src/ui/editbox.rs @@ -381,6 +381,11 @@ impl EditBox { let start = self.selected.get_u32(0)? as usize; let end = self.selected.get_u32(1)? as usize; + // Selection started but nothing selected yet so do nothing + if start == end { + return Ok(()) + } + let sel_start = std::cmp::min(start, end); let sel_end = std::cmp::max(start, end); @@ -627,6 +632,8 @@ impl EditBox { } else if self.is_focused.get() { debug!(target: "ui::editbox", "EditBox unfocused"); self.is_focused.set(false); + self.selected.set_null(0).unwrap(); + self.selected.set_null(1).unwrap(); focus_changed = true; }