Skip to content

Commit

Permalink
Sort child features before storing
Browse files Browse the repository at this point in the history
  • Loading branch information
shashankbrgowda committed Oct 26, 2023
1 parent 94a1ff5 commit e0d78b0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/apollo-shared/src/Changes/AddFeatureChange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,12 @@ export class AddFeatureChange extends FeatureChange {
// @ts-expect-error
_id,
})
// Child features should be sorted for click and drag of gene glyphs to work properly
parentFeature.children = new Map(
[...parentFeature.children.entries()].sort(
(a, b) => a[1].start - b[1].start,
),
)
const childIds = this.getChildFeatureIds(addedFeature)
topLevelFeature.allIds.push(_id, ...childIds)
await topLevelFeature.save()
Expand Down

0 comments on commit e0d78b0

Please sign in to comment.