Giter VIP home page Giter VIP logo

Comments (5)

SimonSteinberger avatar SimonSteinberger commented on July 17, 2024

Sorry, I'm not getting it completely - can you elaborate a bit?

from jquery-autocomplete.

ak4nv avatar ak4nv commented on July 17, 2024

Here you can reproduce a bug. Just click mouse on field to give it focus and select any suggestion in dropdown menu. Dropdown menu will disappear and appear again. Because in your code autocomplete field gets a focus after selecting and then browser makes a request again (cache is false).
My suggestion is add the flag which will set the behavior: return a focus to the field or not after selecting.

if (o.returnFocus) that.focus();

Or maybe suggest a better solution.

from jquery-autocomplete.

SimonSteinberger avatar SimonSteinberger commented on July 17, 2024

Okay, I've just committed an update, but it won't completely fix the issue. Your use case is really a special scenario.

The problem is, "focus" is necessary for using scroll bars in the dropdown suggestions box in Internet Explorer (<= 10). With the updated code, focus is only triggered when actually required to keep the scroll bars working. I believe that's a pretty good compromise, because those IE versions are fortunately fading away slowly.

In the meantime, you could prep your source function in order to prevent double requests or you could patch the plugin code on your own.

If the solution is working for you, I'd close the issue.

from jquery-autocomplete.

SimonSteinberger avatar SimonSteinberger commented on July 17, 2024

Nay, I see that doesn't really fix the issue for you. I'll try something else ...

from jquery-autocomplete.

SimonSteinberger avatar SimonSteinberger commented on July 17, 2024

I'm afraid I'm turning in circles here. In the end, the dropdown box should close when the input field looses focus. However, depending on the browser, the field also looses focus (unwanted) when controlling scroll bars by mouse inside the suggestions. That was actually an issue once:
#12

In order to close the suggestions box without using the blur event, it may be possible to catch events such as pressing tab, shift+tab, hotkeys, click outside the box, etc. Yet, my guess is, that this involves quite an amount of extra code ... If you have an idea, let me know please.

from jquery-autocomplete.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.