Skip to content

automatic content scrolling #680

@paulatanu1

Description

@paulatanu1

I have got one problem…The issue is specifically happening when you select any text → right-click → copy → then move the mouse up/down then automatically scrolling content…
can you please provide any solution how to prevent this issue?

I have try to fix but fully not fix...some time content scrolling

Implementation code:-

` function initCustomScroll() {
const selector =
currentActiveTab === 'clients'
? '.table_card-manage-client.scrollable-body'
: '.table_card-manage-entity.scrollable-body';

    $(selector).mCustomScrollbar('destroy');

    $(selector).mCustomScrollbar({
        setHeight: 470,
        theme: 'minimal-dark',
        scrollbarPosition: 'outside',
        mouseWheel: { preventDefault: true },
        advanced: {
            updateOnContentResize: true,
            autoScrollOnFocus:false,
        },
        callbacks: {
            whileScrolling: function () {
                const scroll = this.mcs.topPct;
                if (scroll >= 70 && !currentParams.is_loading) {
                    handleScrollPagination();
                }
            }
        }
    });

    let isTextSelected = false;

    $(selector).on('mouseup', function(e) {
        if (window.getSelection().toString().length > 0) {
            isTextSelected = true;
        }
    });

    $(selector).on('contextmenu', function(e) {
        if (isTextSelected) {
            $(this).mCustomScrollbar('stop');
        }
    });

    $(selector).on('copy', function() {
    if (isTextSelected) {
        setTimeout(function() {
            window.getSelection().removeAllRanges();
            $(selector).mCustomScrollbar('update');
            isTextSelected = false;
        }, 50);
        }
    });
    $(selector).on('mouseleave', function() {
        isTextSelected = false;
    });
} `

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions