Skip to content

Fix misleading wireReviewCard card-save handler comment (PR #15 round 4) #28

Description

@luandro

Context

PR #15 round-4 added an eventOpener.focusEl refresh inside wireReviewCard's save handler (app.js:1566-1572). The inline comment claims the check runs "after card.replaceWith(replacement) (line 1558), not before" — but card.replaceWith(replacement) is at line 1564, not 1558. The check still works correctly because Element.querySelector walks detached subtrees, but the comment is misleading about the order.

Suggested fix

Update the inline comment in app.js:1566-1572 to clarify that the check intentionally runs after card.replaceWith because Element.querySelector still resolves the old (now-detached) card's child button:

// Issue #15 round 4 (RISK 2): if the open drawer's opener pointed
// at the card we just replaced, refresh its focusEl so
// closeEventDrawer's focus restoration lands on the new button.
// The check runs after card.replaceWith (line 1564) but still
// resolves the old button correctly: Element.querySelector walks
// detached subtrees.

Discovery

Sonnet r4 NIT 2, r6 NIT 2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions