Pricing Blog

Automatically scroll on a div when user write a message ( chat bot )

  • jehex-1400775217474834512

    Jehex

    29 days ago

    Hi there, currently building a chat bot, everything work perfectly fine on desktop but on mobile I have 2 scrolling issues :

    - When the user select a chat, he got redirect to the middle of the conversation so have to scroll down for see the last messages
    - When the ai write a message, it's not automatically scroll down which is not convenient.

    Would like to know if it's a issue of html / css or if a script can do the job.

    Thanks a lot
  • whitep4nth3r-1400827399603748987

    salma

    29 days ago

    I think you can solve this with CSS by using a reversed flex column which will cause the scroll to stick to the bottom
  • use flex-direction column-reverse and ensure you have overflow: auto enabled on the container
  • it's difficult to properly advise without seeing your existing solution
  • jehex-1401074524547584014

    Jehex

    28 days ago

    thanks u gonna try to implement this
  • jehex-1401089471817977976

    Jehex

    28 days ago

    ok simply set overflow to auto fix the issue, thanks