mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-01 16:25:44 +08:00
Closes #15139. The "+ Add" flow in the Set/Edit Metadata modal posted updates with an empty value, so backend saves were silent no-ops and the document's "X fields" count stayed at 0 despite a "Success" toast. The value `<Input>` updates `tempValues` synchronously per keystroke but only writes through to `metaData.values` on blur (via `handleValueBlur`). When the user clicks the nested modal's Confirm button without first blurring, the click handler races the blur and `handleSave` closes over the pre-blur `metaData.values` — still the initial `['']`. `addUpdateValue` then queues an empty-string update; the auto-fire save sends it, and after `resetOperations()` the outer Save button posts `updates: []`. Read from `tempValues` instead so the queued update carries the typed value. Regression test in `tests/use-manage-values-modal.test.ts` asserts that `handleSave` passes the typed value (not the pre-blur empty string) to `addUpdateValue` in the add-new code path.