Use SharedString
for Input
s
This commit is contained in:
parent
5a42ca6772
commit
549e78d7b3
1 changed files with 3 additions and 3 deletions
|
@ -13,17 +13,17 @@ pub enum InputVariant {
|
||||||
#[derive(Element)]
|
#[derive(Element)]
|
||||||
pub struct Input<S: 'static + Send + Sync> {
|
pub struct Input<S: 'static + Send + Sync> {
|
||||||
state_type: PhantomData<S>,
|
state_type: PhantomData<S>,
|
||||||
placeholder: &'static str,
|
placeholder: SharedString,
|
||||||
value: String,
|
value: String,
|
||||||
state: InteractionState,
|
state: InteractionState,
|
||||||
variant: InputVariant,
|
variant: InputVariant,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<S: 'static + Send + Sync> Input<S> {
|
impl<S: 'static + Send + Sync> Input<S> {
|
||||||
pub fn new(placeholder: &'static str) -> Self {
|
pub fn new(placeholder: impl Into<SharedString>) -> Self {
|
||||||
Self {
|
Self {
|
||||||
state_type: PhantomData,
|
state_type: PhantomData,
|
||||||
placeholder,
|
placeholder: placeholder.into(),
|
||||||
value: "".to_string(),
|
value: "".to_string(),
|
||||||
state: InteractionState::default(),
|
state: InteractionState::default(),
|
||||||
variant: InputVariant::default(),
|
variant: InputVariant::default(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue