Code Monkey home page Code Monkey logo

Comments (9)

alexgorbatchev avatar alexgorbatchev commented on August 29, 2024

What's the browser and os you are using?

from jquery-textext.

adamayres avatar adamayres commented on August 29, 2024

I was able to reproduce the issue on Windows 7 using:

Chrome 16
FF 9
IE 9

from jquery-textext.

alexgorbatchev avatar alexgorbatchev commented on August 29, 2024

@adamayres I don't have a windows environment. Do you think it's something you could look into?

from jquery-textext.

adamayres avatar adamayres commented on August 29, 2024

Sure, I can take a look.

from jquery-textext.

jasondavis avatar jasondavis commented on August 29, 2024

I think this may basically be the same as the issue I started here #2

from jquery-textext.

adamayres avatar adamayres commented on August 29, 2024

Yes, I think you are right, all of these issues appear to be related. I have tracked down the issue and was working through a fix to push back.

from jquery-textext.

jasondavis avatar jasondavis commented on August 29, 2024

@adamayres

Here is an image that is more to the point of the problem... You have to click in the area highlighted with red for it to work as expected. So if you click anywhere outside of that red box it will not work, including on the actual text/name of the tag

click area

The ideal solution would allow you to click anywhere in the GREEN highlighted section to add that tag to the input box.
click area

==UPDATE==
Ok I am at a lost, I thought I had it figured out but now it is only working SOMETIMES so it may be more to it then just clicking in the wrong area

from jquery-textext.

adamayres avatar adamayres commented on August 29, 2024

@jasondavis

I think part of the issue is that there is a race condition between the blur event on the input and the click event on the selected row.

There appears to be some consideration for this issue already in textext.plugin.autocomplete.js at line 385-388. If I simply change the timeout to something like 200 ms, things worked for me. However I was not happy with that as a solution.

When the input loses focus from the mousedown event on the row, the blur event handler is closing the autocomplete dropdown before the value is set (since the value will not be set once the dropdown is hidden).

This is also causing the similar issue where in Chrome when using the dropdown scroll bar, the dropdown will close (because in Chrome focus of form fields are lost when clicking scroll buttons).

I was attempting a fix where in the mousedown of the autocomplete I set a data attribute on the container, which could then be used by the blur event to determine if the blur was triggered by a mousedown event from the autocomplete (in which case it would either ignore triggering the close dropdown event or put back the focus in the form input).

I was running into some edge cases with this solution, where if you mousedown inside the dropdown then dragged outside of it and mouseup, then the dropdown could get into a state where it was stuck open (until you chose an item). I was looking into a solution that also put a click handler on the body that would check to see if the coordinates of the event was triggered within the dropdown, if not then close the dropdown. This edge case is caused by this Chrome bug: http://code.google.com/p/chromium/issues/detail?id=31264

from jquery-textext.

alexgorbatchev avatar alexgorbatchev commented on August 29, 2024

Merged.

from jquery-textext.

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.