Skip to content

pantoken-root / formats/interactions/src / initInPlaceEdit

ฟังก์ชัน: initInPlaceEdit() ​

initInPlaceEdit(host, dispatchOn, options?): void

เชื่อมต่อฟิลด์ contenteditable สำหรับพฤติกรรมคลิกเพื่อแก้ไข (commit/revert). กด Enter เพื่อ commit, กด Escape เพื่อ revert; การ blur จะ commit ด้วยหากค่ามีการเปลี่ยนแปลง. จะส่งเหตุการณ์แบบ bubbling change CustomEvent ที่มี detail.value เมื่อ commit

CSS: host = .instui-in-place-edit element (ซึ่งเป็น contenteditable) WC: host = shadow .instui-in-place-edit span

พารามิเตอร์ ​

host ​

HTMLElement

dispatchOn ​

HTMLElement

options? ​

InPlaceEditOptions = {}

คืนค่า ​

void