From 05f254a768f4d5d762ca4801ea2f6c4b77748201 Mon Sep 17 00:00:00 2001 From: Jason Novinger Date: Thu, 20 Nov 2025 11:04:37 -0600 Subject: [PATCH] Fixes #20134: Prevent HTMX OOB swaps in embedded tables (#20811) The htmx/table.html template was unconditionally including out-of-band (OOB) swaps for UI elements that only exist on list pages, causing htmx:oobErrorNoTarget errors when tables were embedded on detail pages. This change adds checks for table.embedded to conditionally exclude OOB swaps for .total-object-count, #table_save_link, and .bulk-action-buttons when rendering embedded tables via the htmx_table template tag. --- netbox/templates/htmx/table.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/netbox/templates/htmx/table.html b/netbox/templates/htmx/table.html index cb80125cf..4cdae4ec1 100644 --- a/netbox/templates/htmx/table.html +++ b/netbox/templates/htmx/table.html @@ -17,15 +17,17 @@ {% if request.htmx %} {# Include the updated object count for display elsewhere on the page #} -
{{ table.rows|length }}
+ {% if not table.embedded %} +
{{ table.rows|length }}
+ {% endif %} {# Include the updated "save" link for the table configuration #} - {% if table.config_params %} + {% if table.config_params and not table.embedded %} Save {% endif %} {# Update the bulk action buttons with new query parameters #} - {% if actions %} + {% if actions and not table.embedded %}
{% action_buttons actions model multi=True %}