Fix loading links from within embedded tables

This commit is contained in:
Jeremy Stretch 2024-04-05 09:45:35 -04:00
parent 9a9d47fc45
commit aff72b132c
2 changed files with 2 additions and 3 deletions

View File

@ -1,9 +1,8 @@
{% load django_tables2 %}
<table{% if table.attrs %} {{ table.attrs.as_html }}{% endif %}>
<table{% if table.attrs %} {{ table.attrs.as_html }}{% endif %} hx-disinherit="hx-target hx-select hx-swap">
{% if table.show_header %}
<thead
hx-target="closest .htmx-container"
hx-disinherit="hx-select hx-swap"
{% if not table.embedded %} hx-push-url="true"{% endif %}
>
<tr>

View File

@ -10,4 +10,4 @@ def htmx_partial(request):
Determines whether to render partial (versus complete) HTML content
in response to an HTMX request, based on the target element.
"""
return request.htmx and request.htmx.target != PAGE_CONTAINER_ID
return request.htmx and request.htmx.target and request.htmx.target != PAGE_CONTAINER_ID