Skip to content

Commit

Permalink
Chat UI build files
Browse files Browse the repository at this point in the history
  • Loading branch information
amit-s19 committed Feb 1, 2024
1 parent 8cbcca8 commit a845d97
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 23 deletions.
2 changes: 1 addition & 1 deletion packages/chat-ui/dist/index.js

Large diffs are not rendered by default.

5 changes: 1 addition & 4 deletions packages/chat-ui/es/components/Chat/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,7 @@ export var Chat = /*#__PURE__*/React.forwardRef(function (props, ref) {
Composer = _props$Composer === void 0 ? DComposer : _props$Composer;
function handleInputFocus(e) {
if (messagesRef && messagesRef.current) {
messagesRef.current.scrollToEnd({
animated: false,
force: true
});
// messagesRef.current.scrollToEnd({ animated: false, force: true });
}
if (onInputFocus) {
onInputFocus(e);
Expand Down
9 changes: 2 additions & 7 deletions packages/chat-ui/es/components/MessageContainer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,10 @@ export var MessageContainer = /*#__PURE__*/React.forwardRef(function (props, ref
}
if (lastMessage.position === 'right') {
// 自己发的消息,强制滚动到底部
scrollToEnd({
force: true
});
// scrollToEnd({ force: true });
} else if (isNearBottom(wrapper, 2)) {
var animated = !!wrapper.scrollTop;
scrollToEnd({
animated: animated,
force: true
});
// scrollToEnd({ animated, force: true });
} else {
setNewCount(function (c) {
return c + 1;
Expand Down
5 changes: 1 addition & 4 deletions packages/chat-ui/lib/components/Chat/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,7 @@ var Chat = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
Composer = _props$Composer === void 0 ? _Composer.Composer : _props$Composer;
function handleInputFocus(e) {
if (messagesRef && messagesRef.current) {
messagesRef.current.scrollToEnd({
animated: false,
force: true
});
// messagesRef.current.scrollToEnd({ animated: false, force: true });
}
if (onInputFocus) {
onInputFocus(e);
Expand Down
9 changes: 2 additions & 7 deletions packages/chat-ui/lib/components/MessageContainer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,10 @@ var MessageContainer = /*#__PURE__*/_react.default.forwardRef(function (props, r
}
if (lastMessage.position === 'right') {
// 自己发的消息,强制滚动到底部
scrollToEnd({
force: true
});
// scrollToEnd({ force: true });
} else if (isNearBottom(wrapper, 2)) {
var animated = !!wrapper.scrollTop;
scrollToEnd({
animated: animated,
force: true
});
// scrollToEnd({ animated, force: true });
} else {
setNewCount(function (c) {
return c + 1;
Expand Down

0 comments on commit a845d97

Please sign in to comment.