fix(editor): focus the first refused field with its own error
A user leave with several refused fields focused the first one while the last refusal owned the single error slot. The leave now focuses the first refused field, then re-applies it so its message shows (I1). The add flow no longer re-pins the tile finish() just ended (M3).
This commit is contained in:
1 parent
78fb2d076e
commit
94f8a8bf27
4 files changed
+134
-35
No files matched your search
@@ -86,13 +86,13 @@ export function useReferenceActions(
|
||||
// P24 (and P22): leave the tile in edit first, then a clean view and the draft.
|
||||
startAdd: () => {
|
||||
if (!tiles.finish()) return
|
||||
shown.reset()
|
||||
shown.reset(null)
|
||||
setDraft((serial) => (serial ?? 0) + 1)
|
||||
},
|
||||
// P24: the new tile is shown whatever was typed meanwhile, so the view is reset.
|
||||
added: (id: string) => {
|
||||
setDraft(null)
|
||||
shown.reset()
|
||||
shown.reset(tiles.editingKey)
|
||||
tiles.reveal(`${id}#0`)
|
||||
later({ kind: 'reference', id })
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user