Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scroll event is not triggering every time a message is received #1926

Closed
keshavnagpal opened this issue Apr 25, 2019 · 8 comments · Fixed by #2107
Closed

Scroll event is not triggering every time a message is received #1926

keshavnagpal opened this issue Apr 25, 2019 · 8 comments · Fixed by #2107
Assignees
Labels
bug Indicates an unexpected problem or an unintended behavior. front-burner p1 Painful if we don't fix, won't block releasing

Comments

@keshavnagpal
Copy link

keshavnagpal commented Apr 25, 2019

here is a video to explain the issue
https://www.loom.com/share/f22dd7020a0a4c5ea53c3a88be87ffee
(pass: webchat)

i'm using master/webchat-es5 (dated 25-Apr-2019)

Update:
We implemented our own solution as a workaround for this, but it might not be as reliable as a fix in webchat library, pasting the implementation below:

var messageListSelector = '#chat-interface ul[role="list"][aria-live="polite"]';
var scrollControl = false;
When action.type === 'DIRECT_LINE/POST_ACTIVITY'
{
scrollControl = true;
}

When action.type === 'DIRECT_LINE/INCOMING_ACTIVITY'
{
if (scrollControl) {
        $(messageListSelector).parent().animate({ scrollTop: $(messageListSelector).height() }, 1000);
    }
    $('#chat-interface input[data-id="webchat-sendbox-input"]').focus();
}
//if user scroll up
$(document).ready(function(){
    $(messageListSelector).bind('mousewheel DOMMouseScroll', function(event){
        event.stopPropagation();
        scrollControl = false;
        var scrollPos = $(messageListSelector).parent().scrollTop();
        var elemHeight = $(messageListSelector).height();
        var srollSkew = elemHeight - scrollPos;
        if (srollSkew > 600 && srollSkew < 636) {
            scrollControl = true;
        }
    });
});
@tdurnford
Copy link
Contributor

@keshavnagpal the video link you shared is private. Can you please change the privacy settings on it so we can see the issue.

This seems to be related to #1031.

@corinagum
Copy link
Contributor

For confirmation, is this occurring in IE11?

@keshavnagpal
Copy link
Author

@tdurnford I had provided the pass in the post, just removed it for simplicity, video is public now.

@corinagum strangely this doesn't occur in ie11 but occurring in chrome (i have Version 73.0.3683.103 if that helps)

@corinagum corinagum added Triage-E bug Indicates an unexpected problem or an unintended behavior. labels Apr 29, 2019
@corinagum
Copy link
Contributor

Repro steps:

  1. receive an adaptive card from the bot
  2. receive suggested actions from the bot
  3. click on a button from the adaptive card

@cwhitten cwhitten added 4.5 p1 Painful if we don't fix, won't block releasing labels May 13, 2019
@compulim
Copy link
Contributor

Investigating if it is because the scrollable container resized while the content is changing. This could be tricky to fix.

@Keshav-GravityILabs
Copy link

Hi, I tried master/webchat-es5.js
The issue seems to be still there
have a look at the video, is this fix supposed to come to master/webchat-es5 after some time?
https://www.loom.com/share/e137632b98ce442b8db0ab2c84bb8ab7

@tdurnford
Copy link
Contributor

This bug has been fixed and will be available in our next release in July. If you need these changes immediately, please see our documentation on pointing to our MyGet feed for latest bits.

@Keshav-GravityILabs
Copy link

Thanks a lot @tdurnford

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or an unintended behavior. front-burner p1 Painful if we don't fix, won't block releasing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants