Hooks.EditableTag = {
inputFieldSelector() { return this.el.dataset.input_elem },
eventName() { return this.el.dataset.event_name },
target() { return document.querySelector(this.el.dataset.target_selector) },
mounted() {
this.el.addEventListener("click", e => {
let inputField = document.getElementById(this.inputFieldSelector())
console.log(this.el.dataset);
// this sends event to the live_component with `editable_tags` (non-live) component
this.pushEventTo(this.target(), this.eventName(), { tag: inputField.value })
})
}
}
This is how I achieved this. Pretty similar.
Thanks @soup



















