Skip to content

pantoken-root / formats/interactions/src / initInPlaceEdit

函式: initInPlaceEdit() ​

initInPlaceEdit(host, dispatchOn, options?): void

為 click-to-edit 的提交/還原行為連接一個 contenteditable 欄位。 Enter 鍵提交,Escape 鍵還原;若值改變,失焦也會提交。 在提交時會觸發一個冒泡的 change CustomEvent,且包含 detail.value。

CSS: host = .instui-in-place-edit element(即為 contenteditable) WC: host = shadow .instui-in-place-edit span

參數 ​

host ​

HTMLElement

dispatchOn ​

HTMLElement

options? ​

InPlaceEditOptions = {}

回傳 ​

void