Skip to content

pantoken-root / formats/interactions/src / initInPlaceEdit

Hàm: initInPlaceEdit() ​

initInPlaceEdit(host, dispatchOn, options?): void

Liên kết một trường contenteditable để hỗ trợ hành vi nhấp-để-chỉnh với commit/hoàn tác. Nhấn Enter để commit, Esc để hoàn tác; blur cũng sẽ commit nếu giá trị đã thay đổi. Phát ra một CustomEvent change (bubbling) với detail.value khi commit.

CSS: host = phần tử .instui-in-place-edit (là contenteditable) WC: host = shadow .instui-in-place-edit span

Tham số ​

host ​

HTMLElement

dispatchOn ​

HTMLElement

options? ​

InPlaceEditOptions = {}

Trả về ​

void