Giter Club home page Giter Club logo

Comments (9)

palespectre avatar palespectre commented on June 27, 2024 1

i ran into the same issue and i found a workaround.

if you want to prevent botui from auto scrolling to the bottom, you just have to remove the scrollIntoView function :

root.Vue.directive('botui-scroll', {
  inserted: function (el) {
    _container.scrollTop = _container.scrollHeight;
      el.scrollIntoView(true);
  }
});

But if you want a nice, smooth and centered scroll, just call scrollIntoView() with these parameters :

root.Vue.directive('botui-scroll', {
  inserted: function (el) {
    _container.scrollTop = _container.scrollHeight;
      el.scrollIntoView({behavior: "smooth", block: "center", inline: "nearest"});
  }
});

from botui.

botviet avatar botviet commented on June 27, 2024 1

My fix:

root.Vue.directive('botui-scroll', {
      inserted: function (el) {
        _container.scrollTop = _container.scrollHeight;
        el.scrollTo(0, el.scrollHeight);
      }
});

from botui.

bsalponia avatar bsalponia commented on June 27, 2024

Did you find any workaround/solution?

from botui.

kyang6 avatar kyang6 commented on June 27, 2024

from botui.

bsalponia avatar bsalponia commented on June 27, 2024

Let me know if this doesn't work! I can try finding my older code.

Kevin it didn't work.

from botui.

victorbuckservices avatar victorbuckservices commented on June 27, 2024

I have the same issue. Any update on a workaround ?

from botui.

fconrotte avatar fconrotte commented on June 27, 2024

I found the solution

you have to replace

<button type="button" :class="button.cssClass" class="botui-actions-buttons-button"

with

<button type="button" :class="button.cssClass" class="botui-actions-buttons-button" v-botui-scroll

and line 214 with

root.Vue.directive('botui-scroll', {
  inserted: function (el) {
    el.scrollIntoView(true);
  }
});

from botui.

Hernan-Torres avatar Hernan-Torres commented on June 27, 2024

Is there any option for not auto scrolling to the bottom?
My client requires that only scroll when there is any question buttons for user.

from botui.

Alagaesia93 avatar Alagaesia93 commented on June 27, 2024

I found out a little bug related to this thread and the el.scrollIntoView(true), but I'm not sure if without it would be ok.

If you have some stuff below the botui component in the page the scroll into view makes the active field appear on top of the page, losing all the other intermediate messages

Example (with bootstrap - try on a very little screen)

<div class="row">
  <div class="col">
    <bot-ui />
  </div>
</div>
<div class="row" style="height: 400px">
  <div class="col">
    <h1>Something else</h1>
  </div>
</div>

The bot schema could be:

  • welcome message
  • buttons
  • other message
  • text field

When you click on the button the page scrolls up to the text field, and the user must scroll up to see the second message.

Thank you for your work, much appreciated!

from botui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.