Skip to content

Commit

Permalink
Update text_input.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
Koranir committed Feb 29, 2024
1 parent a575e62 commit d9b80ac
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions widget/src/text_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,18 +274,6 @@ where
tree::State::new(State::<Renderer::Paragraph>::new())
}

fn diff(&self, tree: &mut Tree) {
let state = tree.state.downcast_mut::<State<Renderer::Paragraph>>();

// Unfocus text input if it becomes disabled
if self.on_input.is_none() {
state.last_click = None;
state.is_focused = None;
state.is_pasting = None;
state.is_dragging = false;
}
}

fn size(&self) -> Size<Length> {
Size {
width: self.width,
Expand Down Expand Up @@ -1139,7 +1127,8 @@ pub fn draw<Theme, Renderer>(
.as_millis()
/ CURSOR_BLINK_INTERVAL_MILLIS)
% 2
== 0;
== 0
&& !is_disabled;

let cursor = if is_cursor_visible {
Some((
Expand Down

0 comments on commit d9b80ac

Please sign in to comment.