From eaada667b32c6eb375aa807f67103d5fbe4dcabf Mon Sep 17 00:00:00 2001 From: veeso Date: Sun, 14 Mar 2021 15:35:02 +0100 Subject: [PATCH] Fixed cursor --- src/ui/layout/components/input.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ui/layout/components/input.rs b/src/ui/layout/components/input.rs index d20c3b4..90677d1 100644 --- a/src/ui/layout/components/input.rs +++ b/src/ui/layout/components/input.rs @@ -33,7 +33,6 @@ use tui::{ style::Style, widgets::{Block, BorderType, Borders, Paragraph}, }; -use unicode_width::UnicodeWidthStr; // -- states @@ -208,7 +207,7 @@ impl Component for Input { // Set cursor, if focus if self.states.focus { let x: u16 = - area.x + (self.states.render_value(self.props.input_type).width() as u16) + 1; + area.x + (self.states.cursor as u16) + 1; render.set_cursor(x, area.y + 1); } }