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

typed event is not firing when text is cleared when closed #197

Open
amiram opened this issue Sep 29, 2021 · 0 comments
Open

typed event is not firing when text is cleared when closed #197

amiram opened this issue Sep 29, 2021 · 0 comments

Comments

@amiram
Copy link

amiram commented Sep 29, 2021

Describe the bug
Using a template for dropdown items, I used a multiline text to show the text and a description. I used the search Callback to search also in the description. I want also to highlight the searched text in the description. Using the typed event I can do that, but this event is not fired when the dropdown is closed and the input text is cleared, so closing and opening the dropdown after a search is performed, ends with highlighted text in the description with no search value.

To Reproduce
https://codesandbox.io/s/compassionate-tdd-rbd1j?file=/src/app/app.component.html

Expected behavior
typed event should fire also when text is cleared.

Note: I can fix that easily with this:

this.inputElRef.nativeElement.value = null;
this.typed.emit(''); // add this line

However, this event is also being listened in the component itself and it triggers too many things that shouldn't be called in such case. Maybe the solution is to separate the internal flow to be triggered by an internal subject that won't be fired in such case, and use the typed event just for outer listeners.

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

No branches or pull requests

1 participant