Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

Hidden 0-index row when there are no search matches, row does not unregister #460

Open
fjurada opened this issue Nov 2, 2020 · 0 comments

Comments

@fjurada
Copy link

fjurada commented Nov 2, 2020

Reproduction steps:

  • Set up the completer (remote or local) with some data
  • Start searching (typing) until there are no matches
  • Press arrow-down (now the 0-index row is selected but that is not visible)
  • Press enter - selecting the invisible row

I have traced the issue to the ngOnDestroy method of the CtrRow directive.
The IF (this_rowIndex) evaluates to false if rowIndex is 0 or undefined - preventing unregistration of the row.

The temporary fix I have made is very ugly and hacky - on one of the parent components wrapping this:
@ViewChildren(CtrRow) set ctrRows(values: QueryList<CtrRow>) { values.forEach((row) => { row.ngOnDestroy = () => { row['dropdown'].unregisterRow(row['_rowIndex']); } }); }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant