Thanks, I ended up using a port and scrollIntoView. However, it seems as 
there's a race condition where the command gets sent to the port before the 
dom has rendered resulting in a "div not found" error. Is there a way to 
fire off messages only after a dom has finished rendering. Right now, I'm 
using a timeout in javascript but it's hacky.

On Tuesday, July 19, 2016 at 12:27:33 AM UTC-7, Ian Mackenzie wrote:
>
> There isn't yet a pure-Elm way to do it, but there's a bunch of discussion 
> going on right now about adding setScrollTop and similar functions (see 
> https://groups.google.com/forum/#!topic/elm-dev/ThkWudq7SF0). In the 
> meantime the answer is likely 'use ports'.
>
> On Tuesday, 19 July 2016 09:27:58 UTC+10, Wayne Choi wrote:
>>
>> I want to scroll down to the bottom of a div for, what else, a chat app. 
>> Right now I'm using element.scrollTop = element.scrollHeight  and it works 
>> fine with just javascript and html. Once I port the div to Elm, however, 
>> the function doesn't scroll all the way down. Am I missing something with 
>> how javascript interacts with the virtual dom? Is there an alternative 
>> solution? 
>>
>

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to