primeng icon indicating copy to clipboard operation
primeng copied to clipboard

autoComplete dropdown button doesn't work

Open sourdoth opened this issue 9 years ago • 8 comments

[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**

<p-autoComplete [(ngModel)]="value" [disabled]="disabled" [dropdown]="true" 
onDropdownClick)="complete($event,true)" field="username" [suggestions]="suggestions" 
completeMethod)="complete($event,false)" (onSelect)="select($event)">
            <ng-template let-user pTemplate="item">
                <user-line [user]="user"></user-line>
            </ng-template>
        </p-autoComplete>


* **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 ]
<!-- All browsers where this could be reproduced -->
 
* **Language:** [all | TypeScript X.X | ES6/7 | ES5]

* **Node (for AoT issues):** `node --version` =   

sourdoth avatar Sep 04 '17 12:09 sourdoth

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

MosheMoualem avatar Sep 05 '17 07:09 MosheMoualem

Same for me. In 4.1.3 is working.

oixan avatar Sep 05 '17 08:09 oixan

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)

mrotzeck avatar Sep 05 '17 13:09 mrotzeck

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.

Abbraxar avatar Sep 05 '17 13:09 Abbraxar

Same for me, Prime NG 4.2

SpiderPork avatar Sep 13 '17 11:09 SpiderPork

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

cagataycivici avatar Sep 14 '17 07:09 cagataycivici

Same here since v4.2.0 😞

kavoos avatar Sep 14 '17 09:09 kavoos

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.

cagataycivici avatar Sep 15 '17 07:09 cagataycivici