Skip to content

SSE swap with transition:true doesn't trigger view transitions #160

@cszczepaniak

Description

@cszczepaniak

It seems like the view transitions API of HTMX doesn't play nicely with the SSE extension (maybe related to #65?)

With the following HTML, the elements do not have an animated transition when updated via SSE (just shuffling the order of them), but when the order is shuffled via the GET request from the button they do transition as expected (with an animation).

<ul
	id="items"
	hx-swap="transition:true"
	hx-ext="sse"
	sse-connect="/sse"
	sse-swap="values"
>
	<li id="item0" style="view-transition-name:item_a;">a</li>
	<li id="item1" style="view-transition-name:item_b;">b</li>
	<li id="item2" style="view-transition-name:item_c;">c</li>
	<li id="item3" style="view-transition-name:item_d;">e</li>
</ul>
<button hx-get="/list" hx-target="#items" hx-swap="transition:true">Click</button>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions