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

ScrollToEndButton causes page to refresh #1741

Closed
Jhanbury opened this issue Feb 19, 2019 · 1 comment
Closed

ScrollToEndButton causes page to refresh #1741

Jhanbury opened this issue Feb 19, 2019 · 1 comment
Assignees
Labels
bug Indicates an unexpected problem or an unintended behavior. p1 Painful if we don't fix, won't block releasing

Comments

@Jhanbury
Copy link

Jhanbury commented Feb 19, 2019

Problem

I'm using the master build for web chat at the moment and I have noticed that clicking the ScrollToEndButton causes the parent webpage to refresh.

However, I cannot reproduce on 4.2.0, so I think its just affecting the master build.

image

Temporary Workaround

I have a workaround for now by doing the following:

    var parentContainer = document.getElementById('{webchatid}');

    parentContainer.addEventListener('click', (event) => {
        var isScrollToEndButton = event.target.nodeName === 'BUTTON' && event.target.className === '{scrolltoendclass}';
        if (isScrollToEndButton) {
            event.preventDefault();
        }
    });

However, I don't think this is a viable workaround going forward.

@compulim I see that the scrollToEndButton uses your react-scroll-to-bottom library for this feature.
What do you think?

@corinagum corinagum added bug Indicates an unexpected problem or an unintended behavior. Pending labels Feb 19, 2019
@corinagum corinagum assigned compulim and corinagum and unassigned compulim Feb 19, 2019
@corinagum corinagum added the p1 Painful if we don't fix, won't block releasing label Feb 19, 2019
@corinagum
Copy link
Contributor

corinagum commented Feb 19, 2019

@Jhanbury thanks for filing this. :) It looks like the scrollToEndButton was missing a type="button" . *Edit: Fix is in PR #1743

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. p1 Painful if we don't fix, won't block releasing
Projects
None yet
Development

No branches or pull requests

3 participants