pub fn replace_selection_with(
value: &mut String,
selection: &mut TextSelection,
replacement: &str,
opts: &TextInputOpts<'_>,
) -> usizeExpand description
replace_selection that respects TextInputOpts::max_length:
the replacement is truncated (by character count) so the post-edit
value doesn’t exceed the cap. Use this for paste / drop / IME
commit flows where the field has a length cap. Returns the byte
length of the actually-inserted text — useful when the caller wants
to know whether the input was clipped.