Rename on_change to on_input for TextInput
This commit is contained in:
parent
f10e936f00
commit
e6a93e960c
12 changed files with 205 additions and 212 deletions
|
|
@ -142,7 +142,7 @@ mod numeric_input {
|
|||
.as_deref()
|
||||
.unwrap_or(""),
|
||||
)
|
||||
.on_change(Event::InputChanged)
|
||||
.on_input(Event::InputChanged)
|
||||
.padding(10),
|
||||
button("+", Event::IncrementPressed),
|
||||
]
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ impl Program for Controls {
|
|||
)
|
||||
.push(
|
||||
text_input("Placeholder", text)
|
||||
.on_change(Message::TextChanged),
|
||||
.on_input(Message::TextChanged),
|
||||
),
|
||||
),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@ impl Sandbox for App {
|
|||
scrollable(options).height(Length::Fill),
|
||||
row![
|
||||
text_input("Add a new option", &self.input)
|
||||
.on_change(Message::InputChanged)
|
||||
.on_input(Message::InputChanged)
|
||||
.on_submit(Message::AddItem(self.input.clone())),
|
||||
button(text(format!("Toggle Order ({})", self.order)))
|
||||
.on_press(Message::ToggleOrder)
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ impl Application for App {
|
|||
column![
|
||||
text("Email").size(12),
|
||||
text_input("abc@123.com", &self.email,)
|
||||
.on_change(Message::Email)
|
||||
.on_input(Message::Email)
|
||||
.on_submit(Message::Submit)
|
||||
.padding(5),
|
||||
]
|
||||
|
|
@ -142,7 +142,7 @@ impl Application for App {
|
|||
column![
|
||||
text("Password").size(12),
|
||||
text_input("", &self.password)
|
||||
.on_change(Message::Password)
|
||||
.on_input(Message::Password)
|
||||
.on_submit(Message::Submit)
|
||||
.password()
|
||||
.padding(5),
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ impl Sandbox for QRGenerator {
|
|||
|
||||
let input =
|
||||
text_input("Type the data of your QR code here...", &self.data)
|
||||
.on_change(Message::DataChanged)
|
||||
.on_input(Message::DataChanged)
|
||||
.size(30)
|
||||
.padding(15);
|
||||
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ impl Sandbox for Styling {
|
|||
);
|
||||
|
||||
let text_input = text_input("Type something...", &self.input_value)
|
||||
.on_change(Message::InputChanged)
|
||||
.on_input(Message::InputChanged)
|
||||
.padding(10)
|
||||
.size(20);
|
||||
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ impl Application for Example {
|
|||
let mut txt_input = text_input(placeholder, &self.data);
|
||||
|
||||
if self.text_edit_enabled {
|
||||
txt_input = txt_input.on_change(Message::TextInputChanged);
|
||||
txt_input = txt_input.on_input(Message::TextInputChanged);
|
||||
}
|
||||
|
||||
let btn = button("Enable/Disable").on_press(StartTimer);
|
||||
|
|
|
|||
|
|
@ -120,14 +120,14 @@ impl Application for App {
|
|||
subtitle(
|
||||
"Title",
|
||||
text_input("", &self.editing.title)
|
||||
.on_change(Message::Title)
|
||||
.on_input(Message::Title)
|
||||
.on_submit(Message::Add)
|
||||
.into()
|
||||
),
|
||||
subtitle(
|
||||
"Message",
|
||||
text_input("", &self.editing.body)
|
||||
.on_change(Message::Body)
|
||||
.on_input(Message::Body)
|
||||
.on_submit(Message::Add)
|
||||
.into()
|
||||
),
|
||||
|
|
|
|||
|
|
@ -205,11 +205,11 @@ impl Application for Todos {
|
|||
.horizontal_alignment(alignment::Horizontal::Center);
|
||||
|
||||
let input = text_input("What needs to be done?", input_value)
|
||||
.on_change(Message::InputChanged)
|
||||
.id(INPUT_ID.clone())
|
||||
.on_input(Message::InputChanged)
|
||||
.on_submit(Message::CreateTask)
|
||||
.padding(15)
|
||||
.size(30)
|
||||
.on_submit(Message::CreateTask);
|
||||
.size(30);
|
||||
|
||||
let controls = view_controls(tasks, *filter);
|
||||
let filtered_tasks =
|
||||
|
|
@ -375,7 +375,7 @@ impl Task {
|
|||
let text_input =
|
||||
text_input("Describe your task...", &self.description)
|
||||
.id(Self::text_input_id(i))
|
||||
.on_change(TaskMessage::DescriptionEdited)
|
||||
.on_input(TaskMessage::DescriptionEdited)
|
||||
.on_submit(TaskMessage::FinishEdition)
|
||||
.padding(10);
|
||||
|
||||
|
|
|
|||
|
|
@ -571,7 +571,7 @@ impl<'a> Step {
|
|||
};
|
||||
|
||||
let mut text_input = text_input("Type something to continue...", value)
|
||||
.on_change(StepMessage::InputChanged)
|
||||
.on_input(StepMessage::InputChanged)
|
||||
.padding(10)
|
||||
.size(30);
|
||||
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ impl Application for WebSocket {
|
|||
|
||||
let new_message_input = {
|
||||
let mut input = text_input("Type a message...", &self.new_message)
|
||||
.on_change(Message::NewMessageChanged)
|
||||
.on_input(Message::NewMessageChanged)
|
||||
.padding(10);
|
||||
|
||||
let mut button = button(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue