Expose select_range in runtime::widget::operation
This commit is contained in:
parent
7c661c94be
commit
e3e94de473
1 changed files with 9 additions and 0 deletions
|
|
@ -86,3 +86,12 @@ pub fn move_cursor_to<T>(id: impl Into<Id>, position: usize) -> Task<T> {
|
||||||
pub fn select_all<T>(id: impl Into<Id>) -> Task<T> {
|
pub fn select_all<T>(id: impl Into<Id>) -> Task<T> {
|
||||||
task::effect(Action::widget(operation::text_input::select_all(id.into())))
|
task::effect(Action::widget(operation::text_input::select_all(id.into())))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Selects the given content range of the widget with the given [`Id`].
|
||||||
|
pub fn select_range<T>(id: impl Into<Id>, start: usize, end: usize) -> Task<T> {
|
||||||
|
task::effect(Action::widget(operation::text_input::select_range(
|
||||||
|
id.into(),
|
||||||
|
start,
|
||||||
|
end,
|
||||||
|
)))
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue