-
Notifications
You must be signed in to change notification settings - Fork 844
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
Fix rule violation in sifrr #526
Conversation
@krausest Please 🙏 |
@krausest I have a question regarding Before
This PR
QuestionBut will this be considered a rule violation:
This will save loop run time. |
It seems you have fall in the same hole like me 😄 The purpose of the test is for measuring the framework speed, and not the direct DOM manipulation speed. I think it's okay to save the id of the item, but you must apply any changes with the framework itself.. |
@aadityataparia You mean like here? |
The only thing I'd consider with such a solution is ensure that swap still works as intended (if the selected row was the one being swapped). I'm not as familiar with if it is different in non-keyed but make sure the functionality works the same. While there aren't testing for all the edge cases you want to make sure your implementation makes sense from how a user would expect interactions to work on a list in which items can be re-ordered and selected at will. |
a5f6b43
to
f81531d
Compare
@krausest Saving it then, But there's one thing I noticed that if you save the index of selected row, and then delete a row above this row, and then select some other row, it won't deselect old row since the saved index is not correct anymore. 🤷♂️ EDIT: Can be fixed by adding index decrement logic in delete event listener though. or getting old selected index during select. On a second note I think i will just find last selected row without saving it to keep expected behaviour in all edge cases. |
f81531d
to
60c0acf
Compare
Thanks. Results have been updated! |
From #516 (comment)