Skip to content

If minChars value is set to 0, display:none on autocomplete-suggestion does not work properly. #56

Open
@nits41089

Description

@nits41089

mousedown event on element

.autocomplete-suggestion

propagates back to input field which triggers focus.

        live('autocomplete-suggestion', 'mousedown', function(e){
           if (hasClass(this, 'autocomplete-suggestion')) { // else outside click
                var v = this.getAttribute('data-val');
                that.value = v;
                o.onSelect(e, v, this);
                that.sc.style.display = 'none';
            }
        }, that.sc);

On focus the below event is triggered, because of which .autocomplete-suggestion is again visible.

if (!o.minChars) addEvent(that, 'focus', that.focusHandler);

To avoid this I have added e.preventDefault(); in live('autocomplete-suggestion', 'mousedown', function(e){...} function.
Please see if you can recreate and provide a better solution for this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions