Skip to content

pantoken-root / formats/interactions/src / initInPlaceEdit

Funkcja: initInPlaceEdit() ​

initInPlaceEdit(host, dispatchOn, options?): void

Podłącza pole contenteditable, aby obsługiwać zachowanie kliknij-aby-edytować: zatwierdzanie/wycofywanie. Naciśnięcie Enter zatwierdza, Escape wycofuje; utrata fokusu także zatwierdza, jeśli wartość się zmieniła. Wyzwala bąbelkujące zdarzenie change CustomEvent z detail.value przy zatwierdzeniu.

CSS: host = .instui-in-place-edit element (który JEST contenteditable) WC: host = shadow .instui-in-place-edit span

Parametry ​

host ​

HTMLElement

dispatchOn ​

HTMLElement

options? ​

InPlaceEditOptions = {}

Zwraca ​

void