-
Notifications
You must be signed in to change notification settings - Fork 319
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
Items in subgroups incorrectly stacking on initial draw and after setItems #343
Comments
I tracked the problem down to the Stack.collisionByTimes method. It looks like that method does a "less than or equal" comparison so abutting subgroups will be stacked. This is different from the behavior of Stack.collision used for items that only does a "less than" comparison so abutting items remain in the same row. I modified collisionByTimes to read:
And it resolved my issue. It looks like this method is only used to layout subgroup heights so it seems pretty safe to modify. I attached an updated, slightly simplified test case that shows the issue when the existing logic is used and shows the proper behavior when the modified logic is used. I don't know this code too well so I'd appreciate a second set of eyes on the change. I can submit a pull ticket if it makes sense. I also don't understand why the item top is calculated using half the vertical margin in code such as:
If you mix normal items and subgroups in the same group the heights don't align properly. But that is another ticket for another day. |
Hi @mpilone , PRs are always welcome! Submit one and I will look over it.
I'm honestly not sure... I think the margin was thought of as a margin from top and bottom. So maybe that's why it's half? really not sure... It seems to be wrong to me. |
🎉 This issue has been resolved in version 7.2.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
I'm seeing an issue in 7.1.3 with items stacking when they shouldn't. The issue appears on the initial draw of the timeline as well as after calling set items. I attached a test case which is just a modified version of a bundled example.
Steps to reproduce:
Expected behavior is that the items/subgroups that abut but don't overlap should be in a continuous row.
I think this is related to subgroups because I don't see it in other places where I don't use subgroups in the timeline but I'm not 100% sure of that.
This might be related to #103 and/or #74 but it isn't clear.
expectedVsActualTimesItems.html.zip
The text was updated successfully, but these errors were encountered: