Skip to content

ScrollToEndButton causes page to refresh #1741

@Jhanbury

Description

@Jhanbury

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?

Metadata

Metadata

Assignees

Labels

bugIndicates an unexpected problem or an unintended behavior.p1Painful if we don't fix, won't block releasing

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions