igorsimb / mp-monitor

Django app for scraping Wildberries
1 stars 0 forks source link

[bug] HTMX Transition for Demo not working properly #134

Open igorsimb opened 4 months ago

igorsimb commented 4 months ago

hero_section.html has a Demo button that triggers hx-get="{% url 'demo' %}" with a transitition (using Transition API).

accounts.views.demo_view redirects user to item_list page at the end.

Problems

  1. If we just use regular return HttpResponseRedirect(reverse("item_list")), transition works fine, but it breaks the offcanvas and demo-tour. My theory is that hx-get somehow fails to load 3rd party javascript on destination.
  2. If we use django-htmx's return HttpResponseClientRedirect(reverse("item_list")), it loads all the necessary javascript on the destination (so offcanvas and demo-tour work perfectly), however the transition no longer works. And the page just switches like it normally would with hx-get.