Renerick / htmx-signalr

htmx extension for interacting with ASP.NET Core SignalR connections directly from HTML
MIT License
44 stars 5 forks source link

scroll:bottom doesn't work with signalr-subscribe #4

Open rpierry opened 1 year ago

rpierry commented 1 year ago

I'm using signalr-subscribe for chat-like functionality on a div with overflow-y: auto and hx-swap beforeend so that new messages have their markup appended to the end of the div. I'd like to automatically scroll the new content into view. This doesn't seem to work.

I think this is the same issue as https://github.com/bigskysoftware/htmx/issues/784 which references https://github.com/bigskysoftware/htmx/issues/255 but I wasn't sure if you wanted to track this separately or not.

I'm pretty sure I can work around this (maybe a load handler in the new p element sent by the server that does scrolling). I don't think handling htmx:signalr:message would work because that happens before - maybe htmx:afterswap or something.