Skip to content
This repository has been archived by the owner on Nov 22, 2021. It is now read-only.

Not able to disable the scrolling when the mouse is hovering the list item #887

Open
felipebetteloni opened this issue Feb 27, 2020 · 1 comment

Comments

@felipebetteloni
Copy link

felipebetteloni commented Feb 27, 2020

The scrolling of the dropdown can be down by moving the mouse down in the autocomplete list. There is no way to disable that.
In the auto-complete.js file, the select function is called when the mouse hovers a list item that triggers the event 'suggestion-selected':

self.select = index => {
      if (index < 0) {
        index = self.items.length - 1;
      }
      else if (index >= self.items.length) {
        index = 0;
      }
      self.index = index;
      self.selected = self.items[index];
      events.trigger('suggestion-selected', index);
    };

And then it calls the function scrollToElement:

events.on('suggestion-selected', index => {
        scrollToElement(element, index);
      });

Is there any way to disable this feature for mouse hovering?

@gauravdixit007
Copy link

gauravdixit007 commented May 28, 2020

@felipebetteloni
Why do you want to disable scrolling in the suggestions-list ?
How will you access all the elements if there are too many items in the list ?

From your description it seems like your issue is something else, because suggestion-selected shouldn't be fired only by hovering over the suggestion-list.
May be your mouse is faulty and clicking itself.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants