Conversation
fe93cbe to
db03626
Compare
db03626 to
45c5f1c
Compare
45c5f1c to
b7620f4
Compare
|
hi |
| first = item.parentKey; | ||
| } | ||
|
|
||
| if (item?.type === 'content') { |
There was a problem hiding this comment.
would you mind commenting the code here?
| parentKey = parent?.parentKey; | ||
| continue; | ||
| } | ||
| let item = getItemElement(ref, parentKey); |
There was a problem hiding this comment.
is this just a check that there is a dom node being rendered? can we just set the collection to being focused and then let the selectable item focus itself? I'm assuming not, but I don't understand why.
Is it in case you drop an item inside another?
There was a problem hiding this comment.
In short, if an item does not exist in the collection, it means its parent is collapsed. In this case, we should not focus that item, but rather focus its parent, which is consistent with our previous behavior. This applies not only to the case of dropping an item inside another item, but also to the case of dropping a parent item with children into another tree: the newly inserted item is collapsed by default, so we should focus the top-level parent.
b7620f4 to
50ee395
Compare
50ee395 to
c14db17
Compare
snowystinger
left a comment
There was a problem hiding this comment.
Thanks for the PR and updates. This way seems like a good start. I'm still mulling over if we want to add something to the collection or somewhere so that droppable collection doesn't need to know about the structure or the rendered items
Closes
✅ Pull Request Checklist:
📝 Test Instructions:
Open the RAC
TreeWithDragAndDropstory, drop "Projects" into the second tree (After the insert, focus should be on the newly inserted item), and attempt to keyboard drag "Projects" again into the second tree. Previously, this caused a bug where focus shifted to the collection, but now it should work correctly.🧢 Your Project: