pub trait TextControlElement: FormControlElement {
// Provided methods
fn value(&self) -> String { ... }
fn set_value(&self, value: impl Into<String>) { ... }
fn placeholder(&self) -> String { ... }
fn set_placeholder(&self, placeholder: impl Into<String>) { ... }
fn readonly(&self) -> bool { ... }
fn set_readonly(&self, readonly: bool) { ... }
fn max_length(&self) -> Option<u32> { ... }
fn set_max_length(&self, max: u32) { ... }
}Expand description
Shared behavior for text-editing form controls (input, textarea).
Chrome equivalent: TextControlElement.
Adds value, selection, and text editing capabilities.
Provided Methods§
fn set_value(&self, value: impl Into<String>)
Sourcefn placeholder(&self) -> String
fn placeholder(&self) -> String
The placeholder text shown when the control is empty.
fn set_placeholder(&self, placeholder: impl Into<String>)
fn set_readonly(&self, readonly: bool)
Sourcefn max_length(&self) -> Option<u32>
fn max_length(&self) -> Option<u32>
Maximum number of characters allowed.
fn set_max_length(&self, max: u32)
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.