Expose select_range in runtime::widget::operation

This commit is contained in:
Héctor Ramón Jiménez 2025-11-25 10:40:12 +01:00
parent 7c661c94be
commit e3e94de473
No known key found for this signature in database
GPG key ID: 7CC46565708259A7

View file

@ -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,
)))
}