Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8705419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:21:15+00:00 2026-06-13T03:21:15+00:00

I have implemented the mCustomScrollbar plugin in my backoffice interfaces. It works fine. But

  • 0

I have implemented the mCustomScrollbar plugin in my backoffice interfaces. It works fine. But in one of my forms, I have a city field that needs the autocomplete.

The autocomplete also works fine. But when I select one of the item from autocomplete source data, the mCustomScrollbar plugin automatically brings me to the top of the scrolling content and I have to click a second time for the item to actually be selected.

This is how I implemented the scrollbar plugin :

$('#mainContent').mCustomScrollbar({
        set_height: height,
        scrollInertia: 500,
        scrollEasing: "easeInOutQuad",
        mouseWheel: 20,
        autoDraggerLength: true,
        advanced: {
            updateOnBrowserResize: true,
            updateOnContentResize: false
        }
    });

And this is how I implemented the autocomplete :

el.autocomplete({
    source: function (request, response) {
        $.ajax({
            url: activityAutocomplete,
            dataType: "json",
            data: request,
            success: function (data) {
                if (data.length == 0) {
                    data.push({
                        label: "Pas de résultat"
                    });
                }
                response(data);
            }
        });
    },
    //If overflow edge of window, the autocomplete flips to top of input
    position: { collision: "flip" },
    autofocus: true,
    delay: 150,
    minLength: 1,
    select: function (event, ui) {
        //ui.hide();
        //The following code resizes the input by bluring it.
        setTimeout(function () { el.autoGrowInput(); }, 50);


    },
    appendTo: '#autocomplete-tb-city-' + el.parents('.item').attr('id')
});

I hope you’ll find something wrong here, i’ve been working on this for like 3 days !

EDIT: This is the generated autocomplete markup.

<ul class="ui-autocomplete ui-menu ui-widget ui-widget-content ui-corner-all"   role="listbox" aria-activedescendant="ui-active-menuitem">
    <li class="ui-menu-item" role="menuitem"><a class="ui-corner-all" tabindex="-1">Angers</a</li>
    <li class="ui-menu-item" role="menuitem"><a class="ui-corner-all" tabindex="-1">Amiens</a</li>
</ul>

I must add something might be importante : it brings me to top even on RIGHT CLICK !!

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T03:21:16+00:00Added an answer on June 13, 2026 at 3:21 am

    I was facing the same issue with autocomplete. Selecting any autocomplete items scrolls the window to the top.

    I saw your comment here, and I think you got the solution.

    Using hint you mentioned in the above link, I went through mcustomscrollbar.js code and just commented out lines 533 and 534 and yeppy it worked for me.

    Thanks for the hint. Cheers !!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have implemented Twitter4J in my Android application and it's works fine. But after
I have implemented Facebook into my app but now I find that whenever I
I have implemented Solr search in one of my .net application. Everything working fine
I have implemented pagination to my data, but the problem is I only have
I have implemented one matrix multiplication with boost::numeric::ublas::matrix (see my full, working boost code
I have implemented a UISearchDisplayController that allows users to search a table. Currently the
I have implemented a simple entity ejb with a @version annotation. I expect that
I have implemented a simple appmod that handle WebSockets and echo back the messages.
I have implemented one application in android which uses epublib to view .epub files.
I have implemented a simple D3.js line chart that can be zoomed and panned.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.