mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-06-06 21:24:10 +00:00
docs: add tasktracking for self-closing tag fix
This commit is contained in:
parent
5ce18ebfc1
commit
a25a42fb9b
1 changed files with 32 additions and 0 deletions
32
docs/Tasktracking/2026-04-25-fix-self-closing-a-empty-tag.md
Normal file
32
docs/Tasktracking/2026-04-25-fix-self-closing-a-empty-tag.md
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
# 2026-04-25 Fix self-closing a-empty tag swallowing sibling elements
|
||||
|
||||
## Problem
|
||||
|
||||
Worker node panel showed an empty card body instead of the master node info table.
|
||||
The API returned correct data (`/panel/api/nodes/list` had the master node), but the
|
||||
rendered DOM was `<div><!----></div>` — both the `<a-empty>` and the info table `<div>`
|
||||
were missing.
|
||||
|
||||
## Root Cause
|
||||
|
||||
Self-closing custom elements (`<a-empty ... />`) are invalid in HTML5 in-DOM templates.
|
||||
The browser's HTML parser does NOT treat `/>` as self-closing for custom elements — it
|
||||
treats `<a-empty ...>` as an **opening tag** and looks for `</a-empty>`.
|
||||
|
||||
This caused the next sibling `<div v-if="nodes.length > 0">` to become a **child** of
|
||||
`<a-empty>` instead of a sibling. When `nodes.length > 0`, the `v-if="nodes.length === 0"`
|
||||
on `<a-empty>` was false, and Vue skipped rendering its entire subtree — including the
|
||||
info table that was accidentally nested inside it.
|
||||
|
||||
Verified with a headless browser:
|
||||
- `<a-empty ... />` followed by `<div>`: div NOT visible (swallowed)
|
||||
- `<a-empty ...></a-empty>` followed by `<div>`: div visible (correct)
|
||||
|
||||
## Fix
|
||||
|
||||
Changed all self-closing `<a-empty ... />` to explicit `<a-empty ...></a-empty>` in
|
||||
`nodes.html`.
|
||||
|
||||
## Files Changed
|
||||
|
||||
- `web/html/nodes.html`: 2 self-closing `<a-empty>` tags → explicit closing tags
|
||||
Loading…
Reference in a new issue