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