fn

applyOverwriteMode

tested

Under a collapsed caret, replace extends the selection to cover the next newCharacters.length characters (so they are overwritten); shift leaves it collapsed (pure insert). An existing range is returned untouched.

Signature

ts
export function applyOverwriteMode(state: ElementState, newCharacters: string, mode: OverwriteMode): ElementState{ ... }

Parameters

ParameterTypeDescription
stateElementState
newCharactersstring
modeOverwriteMode

Returns

ElementState
PropertyTypeDescription
valuestring
selectionSelectionRange