htmx icon indicating copy to clipboard operation
htmx copied to clipboard

Edit Row example allows editing multiple rows when popup dismissed

Open Fraetor opened this issue 1 year ago • 1 comments

Minor issue in the Edit Row example. This example explicitly has a pop up to prevent editing multiple rows simultaneously, with a pop up if a second row is edited before the first has been saved. While this works to reset the first row if the second is edited, when the pop up is canceled it instead allows editing the second row without resetting the first, leaving two editable rows. Example video below.

Screencast from 2024-01-20 23-51-48.webm

Fraetor avatar Jan 20 '24 23:01 Fraetor

It should probably be:

if(result.isConfirmed) {
    htmx.trigger(editing, 'cancel')
    htmx.trigger(this, 'edit')
}                              

As long as "this" does not change its reference. No JS guy.

andryyy avatar Jan 21 '24 08:01 andryyy