Open
Description
What do you think about adding an undo action?
undo(e: Event): void {
e.preventDefault()
// @ts-ignore
const wrapper: HTMLElement = e.target.closest(this.wrapperSelectorValue)
wrapper.style.display = ""
const input: HTMLInputElement = wrapper.querySelector("input[name*='_destroy']")
input.value = "0"
const event = new CustomEvent("rails-nested-form:undo", { bubbles: true })
this.element.dispatchEvent(event)
}
I'm looking for a method like that but I think it's not so simple...
Other important point is about event. Documentation don't tell us about CustomEvent("rails-nested-form:remove", { bubbles: true })
Metadata
Metadata
Assignees
Labels
No labels