Skip to content

Commit 26f464c

Browse files
committed
Scroll to last message on widget show
1 parent 46addfb commit 26f464c

File tree

5 files changed

+7
-5
lines changed

5 files changed

+7
-5
lines changed

lhc_web/design/defaulttheme/js/widgetv2/react.app.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lhc_web/design/defaulttheme/js/widgetv2/react.app.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lhc_web/design/defaulttheme/tpl/pagelayouts/userchat2.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,14 @@
102102
) : ?>
103103
<?php if (!isset($Result['voice_call'])) : ?>
104104
<script <?php isset($Result['app_scope']) ? print 'scope="' . htmlspecialchars($Result['app_scope']) . '"' : '' ?> src="<?php echo erLhcoreClassDesign::design('js/widgetv2/vendor.ie.js')?>?v=a4"></script>
105-
<script <?php isset($Result['app_scope']) ? print 'scope="' . htmlspecialchars($Result['app_scope']) . '"' : '' ?> src="<?php echo erLhcoreClassDesign::design('js/widgetv2/react.app.ie.js')?>?t=388"></script>
105+
<script <?php isset($Result['app_scope']) ? print 'scope="' . htmlspecialchars($Result['app_scope']) . '"' : '' ?> src="<?php echo erLhcoreClassDesign::design('js/widgetv2/react.app.ie.js')?>?t=390"></script>
106106
<?php else : ?>
107107
<script <?php isset($Result['app_scope']) ? print 'scope="' . htmlspecialchars($Result['app_scope']) . '"' : '' ?> src="<?php echo erLhcoreClassDesign::design('js/voice/voice.call.js')?>?t=3"></script>
108108
<?php endif; ?>
109109
<?php else : ?>
110110
<?php if (!isset($Result['voice_call'])) : ?>
111111
<script <?php isset($Result['app_scope']) ? print 'scope="' . htmlspecialchars($Result['app_scope']) . '"' : '' ?> src="<?php echo erLhcoreClassDesign::design('js/widgetv2/vendor.js')?>?v=a4"></script>
112-
<script <?php isset($Result['app_scope']) ? print 'scope="' . htmlspecialchars($Result['app_scope']) . '"' : '' ?> src="<?php echo erLhcoreClassDesign::design('js/widgetv2/react.app.js')?>?t=388"></script>
112+
<script <?php isset($Result['app_scope']) ? print 'scope="' . htmlspecialchars($Result['app_scope']) . '"' : '' ?> src="<?php echo erLhcoreClassDesign::design('js/widgetv2/react.app.js')?>?t=390"></script>
113113
<?php else : ?>
114114
<script <?php isset($Result['app_scope']) ? print 'scope="' . htmlspecialchars($Result['app_scope']) . '"' : '' ?> src="<?php echo erLhcoreClassDesign::design('js/voice/voice.call.js')?>?t=2"></script>
115115
<?php endif; ?>

lhc_web/design/defaulttheme/widget/react-app/src/components/OnlineChat.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,8 @@ class OnlineChat extends Component {
637637
this.setState({scrollButton: true});
638638
// this.messagesAreaRef.current.scrollTop = messageElement.offsetTop - 3;
639639
messageElement.scrollIntoView();
640+
} else if (prevProps.chatwidget.get('shown') === false && this.props.chatwidget.get('shown') === true && messageElement ) {
641+
messageElement.scrollIntoView();
640642
} else {
641643
this.messagesAreaRef.current.scrollTop = this.messagesAreaRef.current.scrollHeight - snapshot;
642644
}

lhc_web/modules/lhwidgetrestapi/settings.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@
558558
$outputResponse['wv'] = 266;
559559

560560
// React APP versions
561-
$outputResponse['v'] = 389;
561+
$outputResponse['v'] = 390;
562562

563563
$cfg = erConfigClassLhConfig::getInstance();
564564

0 commit comments

Comments
 (0)