Primeng: AutoComplete Dropdown click throws error

Created on 27 Mar 2017  路  6Comments  路  Source: primefaces/primeng

In multiple mode, clicking the dropdown throws the error;

AutoComplete.html:17 ERROR TypeError: Cannot read property 'nativeElement' of undefined
defect

Most helpful comment

I still get that error in 4.0.RC3 when [dropdown]="true" and [multiple]="true"

ERROR TypeError: Cannot read property 'nativeElement' of undefined
at AutoComplete.handleDropdownClick (autocomplete.js:196)
at Object.eval [as handleEvent] (AutoComplete.html:19)
at handleEvent (core.es5.js:11805)
at callWithDebugContext (core.es5.js:13013)
at Object.debugHandleEvent [as handleEvent] (core.es5.js:12601)
at dispatchEvent (core.es5.js:8780)
at core.es5.js:9370
at HTMLButtonElement. (platform-browser.es5.js:2683)
at ZoneDelegate.webpackJsonp.780.ZoneDelegate.invokeTask (zone.js:398)
at Object.onInvokeTask (core.es5.js:4116)
at ZoneDelegate.webpackJsonp.780.ZoneDelegate.invokeTask (zone.js:397)
at Zone.webpackJsonp.780.Zone.runTask (zone.js:165)
at HTMLButtonElement.ZoneTask.invoke (zone.js:460)

All 6 comments

I still get that error in 4.0.RC3 when [dropdown]="true" and [multiple]="true"

ERROR TypeError: Cannot read property 'nativeElement' of undefined
at AutoComplete.handleDropdownClick (autocomplete.js:196)
at Object.eval [as handleEvent] (AutoComplete.html:19)
at handleEvent (core.es5.js:11805)
at callWithDebugContext (core.es5.js:13013)
at Object.debugHandleEvent [as handleEvent] (core.es5.js:12601)
at dispatchEvent (core.es5.js:8780)
at core.es5.js:9370
at HTMLButtonElement. (platform-browser.es5.js:2683)
at ZoneDelegate.webpackJsonp.780.ZoneDelegate.invokeTask (zone.js:398)
at Object.onInvokeTask (core.es5.js:4116)
at ZoneDelegate.webpackJsonp.780.ZoneDelegate.invokeTask (zone.js:397)
at Zone.webpackJsonp.780.Zone.runTask (zone.js:165)
at HTMLButtonElement.ZoneTask.invoke (zone.js:460)

I still get that error in 4.0.RC4 when [dropdown]="true" and [multiple]="true"

RC5 as well, same error? Can you post stack trace?

The same in RC5. Problem in _handleDropdownClick_ function.
handleDropdownClick(event) {
this.focusInput();
this.onDropdownClick.emit({
originalEvent: event,
query: this.inputEL.nativeElement.value
});
}

If [multiple]="true" then this.inputEL is undefined. You should use this.multiInputEL as you did in _focusInput_ function.

Thanks, I will check this.

Just checked in primeng 4 Final, working without any problem. Thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

philly-vanilly picture philly-vanilly  路  3Comments

lilling picture lilling  路  3Comments

cyberrranger picture cyberrranger  路  3Comments

Helayxa picture Helayxa  路  3Comments

garethlewis picture garethlewis  路  3Comments