-
-
Notifications
You must be signed in to change notification settings - Fork 45
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
Conditional statement 'bug' #243
Comments
Thanks @rasmuskt . What file are you pointing at? Can you give some link. Also, if it's a bug you are hitting, maybe a reproduction of the bug will make it easier to make progress. |
The file I looked at, is located at the following path: I tried locally changing the condition to see if it would resolve my issue, which it did not. As I am still too unsure what might be causing the issue I am having, I think mixing that issue with this issue would be a mistake. I can briefly mention that I seem to have an issue, where I do not hit any of the scrolling cases, as I can see in the console that I reach 'Scroll intersection not handled...'. Which was the reason I was reading through this part of the code. |
Thanks, though it's still confusing what issues you are running into, please help with a minimal repro that demonstrates the issue. |
(Jakob Gaardsted here, writing instead of Rasmus). The issue is that the logic in _handleScroll is incorrect (in line 657), I therefore do not believe there is a reason to make a repro as it will be 'reproduced' whenever someone tries to use Triggering it is not related to how you use virtual-repeat, but to how the user interacts with the UI We are really after a wholly different bug - we routinely see _handleScroll's case 7 (the 'error/conflict catch') If the following expression is really correct, then I think it is a very weird way to write it?? // scrolling up and reach top Rasmus will go on vacation from today, but I will continue to check up on this issue ticket, please let us know if we have overlooked anything. Or if you would like us/me to elaborate on something. Best regards, |
Thanks for the explanation. There' cases where the logic maybe isn't good enough, maybe with the small movement of the scrollbar. I don't have a test for this so it's often quite hard to get to the bottom of it. |
I have been looking further into this. The second bug is triggering 'Scroll intersection not handled.' in line 735. The 6 cases that _handleScroll tries to distribute (start_range_change, end_range_change) across, We routinely experience the combination That combination is not covered by the 6 cases _handleScroll contains, I am not sure what causes it, but I'm guessing it maybe happens I would love to (?) ignore the problem, but unfortunately our application console log looks like this: |
I have some updated details, possibly related to what you intend by a 'minimal repro'(?): (3) apparently, the _handleScroll subsystem is not happy, (4) so, if I just assign (or append/splice/push) to the observed container, it gets angry/sad. (6) however, it is not enough to truncate it. (7) also, the truncate-method must also be specific: It works, if I assign an empty array [] to it. (this is the two-star note - I give up typing two asterisks in markdown :-/.) (*) The reason for changing the contents of a currently displayed container, is (***) I'm currently "in love with" that we can circumvent this issue by writing our container-updates Anyway, to recap: We experience this problem, whenever searching on an open screen, To elaborate on that: When we do this, I can see, that the case-7 error ranges tells us, So it looks like new-end-range 'didnt get the memo', it still lives in a world of 100 items (before we updated the container). xxx-start-range doesn't really enter the picture(?) - both old and new start is zero/0. But, to recap: If we violently empty the observed container, before we update, Here some examples again, of the indices appearing outside the expected range of [0-49]: [!] Scroll intersection not handled. With indices: new [0, 67] / old [0, 49] aurelia-ui-virtualization.js:967 |
General info
Issue
After reviewing the newest version of the code, the following conditional statement has an issue in the second case (line 921-922).
The second case
new_range_end_index === old_range_end_index && old_range_end_index >= new_range_end_index
equals comparison does not make sense . The intention of the case is to test for 'near top', to mirror the case of 'near bottom'. By mistakenly referring to the end-ranges in the equals comparison, it fails to be a 'near top' test, and instead sort of nullifies the second case.Fix
The second case should instead be changed to
new_range_start_index === old_range_start_index && old_range_end_index >= new_range_end_index
The text was updated successfully, but these errors were encountered: