advanced-chat / vue-advanced-chat

A beautiful chat rooms web component compatible with all Javascript frameworks
https://advanced-chat.github.io/vue-advanced-chat/
MIT License
1.73k stars 467 forks source link

Search does not work correctly after page load. #330

Open NINI1988 opened 2 years ago

NINI1988 commented 2 years ago

Describe the bug

The Search bar does not filter correctly after page load. And it seams like that the fetch-more-rooms event is not fired correctly.

Steps to reproduce

  1. Go to https://antoine92190.github.io/vue-advanced-chat/
  2. Paste eg. xxxxxxnoxxxtextxxxxxxfoundxxxxxxxx in the search bar
  3. Remove the search text and paste it again
  4. After around 5 retries the whole conversation list has been loaded and after that the filterring works as expected

Expected behavior

There should be no conversation be visible, because the search text can not be found. And the whole conversation list should be loaded, because fetch-more-rooms must be fired the whole time when the end of the conversation list is reached.

Screenshots

Bildschirmfoto am 2022-07-14 um 21 13 29

Device

Additional context

NINI1988 commented 2 years ago

Is it maybe the case that the filtering is not applied when the conversation list has been changed?

antoine92190 commented 2 years ago

Indeed there is an issue there. I think the best would be to add a custom behaviour when searching rooms, so you are able to filter rooms on your side and make the feature more flexible, especially when using pagination.

NINI1988 commented 2 years ago

For me it is OK to have the default implementation of the search bar. We don't have that many conversations, but it would be nice if the search would work as expected.

And optional an implementation for custom searches for other scenarios.