Input add set_placeholder method (#131)

This commit is contained in:
Floyd Wang 2024-08-09 17:24:29 +08:00 committed by GitHub
parent e073b60bc1
commit 283b319edd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -261,6 +261,11 @@ impl TextInput {
self self
} }
/// Set the placeholder text without ownership.
pub fn set_placeholder(&mut self, placeholder: impl Into<SharedString>) {
self.placeholder = placeholder.into();
}
/// Set true to show the clear button when the input field is not empty. /// Set true to show the clear button when the input field is not empty.
pub fn cleanable(mut self, cleanable: bool) -> Self { pub fn cleanable(mut self, cleanable: bool) -> Self {
self.cleanable = cleanable; self.cleanable = cleanable;