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

Bugfix - Server side render #1081 #1095

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

aloysb
Copy link
Contributor

@aloysb aloysb commented Aug 17, 2022

This PR fix the issue as described on #1081 🎉 🍻

There is not, as far as I can tell, a reason to have the search set up as a controlled input.
I've removed it, as it was creating a racing condition with the debouncing/async API call.

When the API returned, it would override the current input value by the search.
Coupled with the debouncing, it would create weird situations where depending on how fast you typed vs. how fast the server responded, some letters seemed to disappear.

There were two ways to go about it:

  1. Keep the 'input value' and 'search' in two separate places,
  2. Eliminate the need to keep the input value in the state,

I went for 2 - Keep It Simple, Silly.

This solves issue #1081 🎉

There is no E2E set up for the search, so I'm pushing this as a hotfix - but we should think about bringing more E2E to the table.

================
On a side note,

@afshinm feel free to contact me. I'm happy to contribute regularly to grid-js - I've rolled out my own table package internally and I have come to realise how much work it is. 😪
I'd be happy to help out here: a nice language agnostic, pluggable table package is very much needed and it seems that Grid-js might need some TLC 🧽 ❤️ 💅

Cheers 😃

@afshinm afshinm added the bug fix Something isn't working label Aug 20, 2022
@@ -113,7 +113,6 @@ export class Search extends PluginBaseComponent<
className('input'),
className('search', 'input'),
)}
value={this.store.state.keyword}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add a test for this please? I'm wondering why we don't need the keyword value in the store

@aloysb
Copy link
Contributor Author

aloysb commented Aug 20, 2022 via email

@aloysb
Copy link
Contributor Author

aloysb commented Aug 27, 2022 via email

@afshinm
Copy link
Member

afshinm commented Aug 27, 2022

hey @aloysb, oh no, sorry I didn't see your message. I'm not usually online on Discord.

Are you getting any errors when running the tests? I actually think it makes more sense to use the testing library instead of Enzyme, I did that for the gridjs-react wrapper last week.

@mhmcdonald
Copy link

mhmcdonald commented Sep 21, 2022

@afshinm @aloysb - thank you so much for working on this and I'm sorry that I can't assist with this myself, but is there any chance we could get this merged in? This bug is making the server side search a bit of a poor experience for my users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fix Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants