Primeng: autoComplete dropdown button doesn't work

Created on 4 Sep 2017  路  8Comments  路  Source: primefaces/primeng

[x ] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35
```

Current behavior
when property [dropdown]="true" in autoComplete show the button but doesn't display
data when i clicked (this work well in version 4.1.3). If i write to find data it work

Expected behavior
show data when i click button in autoComplete

Minimal reproduction of the problem with instructions

onDropdownClick)="complete($event,true)" field="username" [suggestions]="suggestions"
completeMethod)="complete($event,false)" (onSelect)="select($event)">



  • Angular version: 4.2

  • PrimeNG version: 4.2.0-rc.1

  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]

  • Language: [all | TypeScript X.X | ES6/7 | ES5]

  • Node (for AoT issues): node --version =

defect

Most helpful comment

This is fixed now but there is an important change, dropdown now handles the search itself to make it easier since you need to do a query manually on onDropdownClick yourself. New behavior eliminates this by introducing dropdownMode property. From the new docs;

Enabling dropdown property displays a button next to the input field where click behavior of the button is defined using dropdownMode property that takes "blank" or "current" as possible values. "blank" is the default mode to send a query with an empty string whereas "current" setting sends a query with the current value of the input.

Also please see;

https://github.com/primefaces/primeng/issues/3956

My suggestion would be updating to new version and removing your onDropdownClick handler.

All 8 comments

same here, Since I updated ng-prime to version 4.2.0-rc.1 and the dropdown stopped work.

Same for me. In 4.1.3 is working.

Same here. Seems that in 4.2.0-rc.1, autocomplete does not capture update to the [suggestions] attribute unless it was called by (completeMethod)

This problem occurs because in the component, the method handleDropdownClick miss this.loading = true;. Loading at true is needed in handleSuggestionsChange function.

    handleDropdownClick(event) {
        this.focusInput();
        let queryValue = this.multiple ? this.multiInputEL.nativeElement.value : this.inputEL.nativeElement.value;

        // miss that
        this.loading = true;

        this.onDropdownClick.emit({
            originalEvent: event,
            query: queryValue
        });
    }

I don't have time to PR now even if it's a really easy fix.

Same for me, Prime NG 4.2

@merve7 can you try the change of @Abbraxar please.

Same here since v4.2.0 馃槥

This is fixed now but there is an important change, dropdown now handles the search itself to make it easier since you need to do a query manually on onDropdownClick yourself. New behavior eliminates this by introducing dropdownMode property. From the new docs;

Enabling dropdown property displays a button next to the input field where click behavior of the button is defined using dropdownMode property that takes "blank" or "current" as possible values. "blank" is the default mode to send a query with an empty string whereas "current" setting sends a query with the current value of the input.

Also please see;

https://github.com/primefaces/primeng/issues/3956

My suggestion would be updating to new version and removing your onDropdownClick handler.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

papiroca-tm picture papiroca-tm  路  3Comments

SchneMa picture SchneMa  路  3Comments

jisqaqov picture jisqaqov  路  3Comments

watalberto picture watalberto  路  3Comments

mitosandov picture mitosandov  路  3Comments