From f29772010ee1e35f7eef825d986ad8c5fbe27660 Mon Sep 17 00:00:00 2001 From: Jamey Greenwood Date: Wed, 21 Jan 2026 20:20:39 +0000 Subject: [PATCH] fix: resolve nested HTML documents causing LiveView binding errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The shop.html.heex and shop_root.html.heex were both full HTML documents. When nested (root layout + live layout), this created invalid HTML with duplicate , , , and tags. This caused: - "Cannot bind multiple views to the same DOM element" console errors - Failed Lighthouse audits - Potential rendering issues Fix: - shop_root.html.heex: Now contains the full HTML document with theme settings, CSS variables, and data attributes - shop.html.heex: Now just passes through @inner_content Results: - Console errors: Gone - Best Practices: 96 → 100 - Total Blocking Time: 140ms → 30ms - HTML validation: Passes Co-Authored-By: Claude Opus 4.5 --- .../components/layouts/shop.html.heex | 32 +------------------ .../components/layouts/shop_root.html.heex | 22 ++++++++++--- 2 files changed, 19 insertions(+), 35 deletions(-) diff --git a/lib/simpleshop_theme_web/components/layouts/shop.html.heex b/lib/simpleshop_theme_web/components/layouts/shop.html.heex index 66a1217..0543398 100644 --- a/lib/simpleshop_theme_web/components/layouts/shop.html.heex +++ b/lib/simpleshop_theme_web/components/layouts/shop.html.heex @@ -1,31 +1 @@ - - - - - - - <.live_title><%= assigns[:page_title] || @theme_settings.site_name %> - - - - - - -
- <%= @inner_content %> -
- - +<%= @inner_content %> diff --git a/lib/simpleshop_theme_web/components/layouts/shop_root.html.heex b/lib/simpleshop_theme_web/components/layouts/shop_root.html.heex index 09c1730..e185c1b 100644 --- a/lib/simpleshop_theme_web/components/layouts/shop_root.html.heex +++ b/lib/simpleshop_theme_web/components/layouts/shop_root.html.heex @@ -4,14 +4,28 @@ - <.live_title default="SimpleshopTheme"> - {assigns[:page_title]} - + <.live_title><%= assigns[:page_title] || @theme_settings.site_name %> + + - {@inner_content} +
+ {@inner_content} +