Comments (9)
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.
My fix:
root.Vue.directive('botui-scroll', {
inserted: function (el) {
_container.scrollTop = _container.scrollHeight;
el.scrollTo(0, el.scrollHeight);
}
});
from botui.
Did you find any workaround/solution?
from botui.
from botui.
Let me know if this doesn't work! I can try finding my older code.
Kevin it didn't work.
from botui.
I have the same issue. Any update on a workaround ?
from botui.
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.
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.
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)
- Cards as action (like messenger) HOT 1
- Is it possible to change the "three typing dots" color?
- Text value passed to action(input element) is not updated on android phones
- Is it possible to Stop/Pause Chatbot and Perform an action in Modal and then on closing the modal we continue the chat?
- Dropdown not working, other actions working fine
- button after link issue. - depend on vue version
- Multiple instances of BotUI
- 点击之后页面老往下滑 HOT 1
- Can we use it in Angular 8 Project HOT 1
- Uncaught TypeError: root.Vue.directive is not a function on firefox and chrome and mobile browsers, only working on Safari desktop
- Backend builder HOT 6
- Scroll to the bottom only if scroll already is at bottom
- how to use it in vue ??? there are some errors HOT 2
- Attribute "pattern" inside action.text HOT 1
- How i can save progress?
- botui.action.select does not show dropdown HOT 2
- Are links working? HOT 2
- Using react typescript project with storybook - failing run storybook HOT 1
- Is there a way to assign onChange event to the action textbox HOT 1
- Time stamp HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from botui.