Skip to content

Commit

Permalink
fix(index): Prevent side attachable block from adding at index 0
Browse files Browse the repository at this point in the history
  • Loading branch information
SyntaxGalaxy committed Nov 23, 2023
1 parent 0874c0d commit 5859dab
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,9 @@ public boolean onDrag(View v, DragEvent dragEvent) {
attachableBlockView.setEnableEdit(true);
attachableBlockView.setBlock(blockDefaultView.getBlock());
}
if (index == 0) {
index = 1;
}
((ViewGroup) v).addView(attachableBlockView, index);
Utils.setMargins(attachableBlockView, -16, 0, 0, 0);
}
Expand Down

0 comments on commit 5859dab

Please sign in to comment.