Skip to content

fix(core): harden RedBox and autocompleter dialog DOM handling#167

Merged
TDannhauer merged 2 commits into
FRAMEWORK_6_0from
fix/redbox-autocompleter-dialog-reopen
Jun 18, 2026
Merged

fix(core): harden RedBox and autocompleter dialog DOM handling#167
TDannhauer merged 2 commits into
FRAMEWORK_6_0from
fix/redbox-autocompleter-dialog-reopen

Conversation

@TDannhauer

Copy link
Copy Markdown
Contributor

Summary

  • Fix RedBox and autocompleter DOM handling that prevented dialog overlays from reopening cleanly
  • Avoid destructive Element#update() when moving dialog HTML into RB_window
  • Harden PrettyAutocompleter and KeyNavList teardown against detached nodes

Motivation

Kronolith's event edit dialog uses RedBox with PrettyAutocompleter fields for attendees and tags. After closing the dialog once, reopening failed with parentNode is null errors from removeChild, leaving overlays and autocompleter state inconsistent.

Changes

  • redbox.js: replace RB_window.update(html) with a non-destructive move that parks previous children on document.body
  • prettyautocomplete.js: re-init when box/input is detached; guard removeItemNode(), updateInput(), and currentEntries(); remove orphaned box nodes before rebuild
  • keynavlist.js: guard destroy() when dropdown nodes are already detached

Companion PR in horde/kronolith wires these fixes into the event dialog lifecycle.

Test plan

  • In Kronolith, open/close/reopen event dialogs with attendee and tag autocompleters populated
  • Verify no JavaScript console errors on second and third open
  • Smoke-test other RedBox dialogs (tasks, calendars) still open and close normally

Replace destructive RB_window updates with non-destructive moves, and guard PrettyAutocompleter and KeyNavList teardown when nodes are detached. Fixes event dialog reopen failures in Kronolith.
@TDannhauer TDannhauer requested a review from ralflang June 18, 2026 15:16
@TDannhauer TDannhauer merged commit 6ef7b65 into FRAMEWORK_6_0 Jun 18, 2026
0 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants