pub trait CaretPosition {
// Required methods
fn select_all(&self) -> ApiResult<()>;
fn set_caret_position(&self, offset: usize) -> ApiResult<()>;
fn get_caret_position(&self) -> Option<u32>;
}Expand description
Utilities for caret position. DOM elements have different APIs for this
but Deref makes them fall through, so it is important that this method
be called on the correct struct type!
Required Methods§
Sourcefn select_all(&self) -> ApiResult<()>
fn select_all(&self) -> ApiResult<()>
Select the entired clip
Sourcefn set_caret_position(&self, offset: usize) -> ApiResult<()>
fn set_caret_position(&self, offset: usize) -> ApiResult<()>
Set the caret to a specific offset.
Sourcefn get_caret_position(&self) -> Option<u32>
fn get_caret_position(&self) -> Option<u32>
Get the caret’s offset (if it has focus)