parent
08cf199b39
commit
97df4efd46
2 changed files with 14 additions and 6 deletions
|
|
@ -1,6 +1,6 @@
|
|||
use gpui::{
|
||||
div, App, AppContext as _, Context, Entity, InteractiveElement, IntoElement,
|
||||
ParentElement as _, Render, Styled, Subscription, Window,
|
||||
App, AppContext as _, Context, Entity, InteractiveElement, IntoElement, ParentElement as _,
|
||||
Render, Styled, Subscription, Window, div,
|
||||
};
|
||||
|
||||
use crate::section;
|
||||
|
|
@ -121,13 +121,20 @@ impl InputStory {
|
|||
&mut self,
|
||||
state: &Entity<InputState>,
|
||||
event: &InputEvent,
|
||||
_window: &mut Window,
|
||||
_cx: &mut Context<Self>,
|
||||
window: &mut Window,
|
||||
cx: &mut Context<Self>,
|
||||
) {
|
||||
match event {
|
||||
InputEvent::Change => {
|
||||
let text = state.read(_cx).value();
|
||||
println!("Change: {}", text)
|
||||
let text = state.read(cx).value();
|
||||
if state == &self.input2 {
|
||||
println!("Set disabled value: {}", text);
|
||||
self.disabled_input.update(cx, |this, cx| {
|
||||
this.set_value(text, window, cx);
|
||||
})
|
||||
} else {
|
||||
println!("Change: {}", text)
|
||||
}
|
||||
}
|
||||
InputEvent::PressEnter { secondary } => println!("PressEnter secondary: {}", secondary),
|
||||
InputEvent::Focus => println!("Focus"),
|
||||
|
|
|
|||
|
|
@ -637,6 +637,7 @@ impl InputState {
|
|||
) {
|
||||
self.history.ignore = true;
|
||||
let was_disabled = self.disabled;
|
||||
self.disabled = false;
|
||||
self.replace_text(value, window, cx);
|
||||
self.disabled = was_disabled;
|
||||
self.history.ignore = false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue