Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autoComplete dropdown button doesn't work #3829

Closed
sourdoth opened this issue Sep 4, 2017 · 8 comments
Closed

autoComplete dropdown button doesn't work #3829

sourdoth opened this issue Sep 4, 2017 · 8 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@sourdoth
Copy link

sourdoth commented Sep 4, 2017

[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` =   
@MosheMoualem
Copy link

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

@oixan
Copy link

oixan commented Sep 5, 2017

Same for me. In 4.1.3 is working.

@Merve7 Merve7 self-assigned this Sep 5, 2017
@mrotzeck
Copy link

mrotzeck commented Sep 5, 2017

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)

@Abbraxar
Copy link

Abbraxar commented Sep 5, 2017

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.

@SpiderPork
Copy link

Same for me, Prime NG 4.2

@cagataycivici cagataycivici added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label Sep 14, 2017
@cagataycivici cagataycivici added this to the 4.2.1 milestone Sep 14, 2017
@cagataycivici
Copy link
Member

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

@kavoos
Copy link

kavoos commented Sep 14, 2017

Same here since v4.2.0 😞

@cagataycivici
Copy link
Member

cagataycivici commented Sep 15, 2017

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;

#3956

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

9 participants