TextSelection
A range of a TextField's text, for reading or setting the caret and what the user selected.
Usage
React to a change outside the UI
This type is used by TextField
import { TextField, signal, watch } from 'kuito';
export function Search(props: { search: (query: string) => void }) {
const query = signal('');
watch(query, (text) => {
const timer = setTimeout(() => props.search(text), 250);
return () => clearTimeout(timer);
});
return <TextField label="Search" value={query} />;
}Type declaration
export interface TextSelection {
start: number;
end: number;
}Members 2
| Name | Type | Required | Description |
|---|---|---|---|
start | number | Yes | — |
end | number | Yes | — |
Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.