diff --git a/src/index.ts b/src/index.ts index 5dd0999..702e27e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -445,6 +445,7 @@ export default class CanvasSelect extends EventBus { this.dataset.forEach((item, i) => item.active = i === hitShapeIndex); this.dataset.splice(hitShapeIndex, 1); this.dataset.push(hitShape); + this.dataset.sort((a, b) => a.index - b.index); if (!this.readonly) { this.remmber = []; if ([Shape.Dot, Shape.Circle].includes(hitShape.type)) {