Skip to content

Commit 16a6fa9

Browse files
committed
set updating on click
1 parent 97b6d37 commit 16a6fa9

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/widgets/forms.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1879,7 +1879,14 @@ export function buildCheckboxForm (dom, kb, lab, del, ins, form, dataDoc, trista
18791879
refresh()
18801880
if (!editable) return box
18811881

1882+
let isUpdating = false // Prevent concurrent updates on double-click
1883+
18821884
const boxHandler = function (_e) {
1885+
if (isUpdating) {
1886+
return // Ignore clicks while update is in progress
1887+
}
1888+
isUpdating = true
1889+
input.disabled = true // Disable button to provide user feedback
18831890
colorCarrier.style.color = '#bbb' // grey -- not saved yet
18841891
const toDelete = input.state === true ? ins : input.state === false ? del : []
18851892
input.newState =
@@ -1900,6 +1907,8 @@ export function buildCheckboxForm (dom, kb, lab, del, ins, form, dataDoc, trista
19001907
success,
19011908
errorBody
19021909
) {
1910+
isUpdating = false
1911+
input.disabled = false
19031912
if (!success) {
19041913
if (toDelete.why) {
19051914
const hmmm = kb.holds(

0 commit comments

Comments
 (0)