Fix ported-component styling regressions
Two visual regressions from the custom-element port: 1. The played-row nested its dropdown menu (which contains <button> options) inside the toggle <button>. A <button> may not contain another <button>; the HTML parser force-closes the toggle on the nested button, and the source's explicit </div> tags then close ancestors early — ejecting the Purchases/Sessions/etc. sections out of the centered max-w container (they rendered full-width). Make the menu a sibling of the toggle, wrapped in a relative div so it still anchors under the toggle. 2. Both selector toggles dropped the original `flex flex-row gap-4 justify-between items-center` wrapper around their content, so the chevron stacked under the label (the GameStatus label is a display:flex block). Restore the wrapper — chevron sits on the right with proper spacing again. Verified by screenshot: sections back inside the centered container; both dropdowns render correctly. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+7
-5
@@ -386,13 +386,15 @@ def _played_row(game: Game, request: HttpRequest) -> Node:
|
||||
[
|
||||
("type", "button"),
|
||||
("data-toggle", ""),
|
||||
("class", _PLAYED_BTN + " rounded-e-lg relative"),
|
||||
("class", _PLAYED_BTN + " rounded-e-lg"),
|
||||
],
|
||||
[Icon("arrowdown"), menu],
|
||||
[Icon("arrowdown")],
|
||||
)
|
||||
group = Div(class_="inline-flex rounded-md shadow-2xs relative")[
|
||||
count_button, toggle
|
||||
]
|
||||
# Menu is a SIBLING of the toggle (not nested inside it): a <button> may not
|
||||
# contain another <button>, and that invalid nesting makes the HTML parser
|
||||
# close ancestors early, ejecting later page sections from their container.
|
||||
toggle_group = Div(class_="relative")[toggle, menu]
|
||||
group = Div(class_="inline-flex rounded-md shadow-2xs")[count_button, toggle_group]
|
||||
return custom_element(
|
||||
"play-event-row",
|
||||
PlayEventRowProps(
|
||||
|
||||
Reference in New Issue
Block a user