chore: update text input

This commit is contained in:
2025-05-21 18:48:00 +07:00
parent e851063de9
commit b0a6b73801
6 changed files with 249 additions and 80 deletions

View File

@@ -137,7 +137,7 @@ impl RenderOnce for TextInput {
const LINE_HEIGHT: Rems = Rems(1.25);
self.state.update(cx, |state, _| {
state.height = self.height;
state.mode.set_height(self.height);
state.disabled = self.disabled;
});
@@ -187,7 +187,7 @@ impl RenderOnce for TextInput {
.on_action(window.listener_for(&self.state, InputState::right))
.on_action(window.listener_for(&self.state, InputState::select_left))
.on_action(window.listener_for(&self.state, InputState::select_right))
.when(state.multi_line, |this| {
.when(state.is_multi_line(), |this| {
this.on_action(window.listener_for(&self.state, InputState::up))
.on_action(window.listener_for(&self.state, InputState::down))
.on_action(window.listener_for(&self.state, InputState::select_up))
@@ -228,7 +228,7 @@ impl RenderOnce for TextInput {
.cursor_text()
.input_py(self.size)
.input_h(self.size)
.when(state.multi_line, |this| {
.when(state.is_multi_line(), |this| {
this.h_auto()
.when_some(self.height, |this, height| this.h(height))
})