Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Remove inserter inside multi-selection #3246
How Has This Been Tested?
Make a multi block selection. Make sure there are inserters around the block (visible by hover), but not inside the block.
@@ Coverage Diff @@ ## master #3246 +/- ## ========================================== + Coverage 34.65% 34.65% +<.01% ========================================== Files 260 260 Lines 6741 6752 +11 Branches 1220 1225 +5 ========================================== + Hits 2336 2340 +4 - Misses 3719 3723 +4 - Partials 686 689 +3
Elsewhere I've been combatting frequent re-renders of this component where the common culprit is the multi-selection props (see #3247, #3170). I think we would be better served, both for intent and performance, to have more of a separation between multi-selection and block list rendering.
As it impacts here, I wonder if it should be the responsibility of the sibling inserter to determine if it should be visible (or return
null) depending on if the
insertIndex is within range of the current multi-selection?
In this case I would suggest passing as a boolean prop into
In a normal case I wouldn't be too bothered one way or the other whether this logic is controlled by the list component or the child itself, but since inserter is otherwise a simple component and the block list component is excessively complex, it could help readability to delegate this behavior to the child.
In this specific circumstance, there's probably not much of a performance difference, only because we already have