From ab2f980b72fcf17f736569f2052ceae1c21f4271 Mon Sep 17 00:00:00 2001 From: Colin Date: Thu, 14 Mar 2024 14:01:43 -0400 Subject: [PATCH] Fix sort after changing feature height --- plugins/alignments/src/LinearPileupDisplay/model.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/plugins/alignments/src/LinearPileupDisplay/model.ts b/plugins/alignments/src/LinearPileupDisplay/model.ts index c49e3ac03b..b3c9c20856 100644 --- a/plugins/alignments/src/LinearPileupDisplay/model.ts +++ b/plugins/alignments/src/LinearPileupDisplay/model.ts @@ -21,7 +21,7 @@ import SortIcon from '@mui/icons-material/Sort' import { SharedLinearPileupDisplayMixin } from './SharedLinearPileupDisplayMixin' import { observable } from 'mobx' -// async +// lzies const SortByTagDialog = lazy(() => import('./components/SortByTag')) const ModificationsDialog = lazy( () => import('./components/ColorByModifications'), @@ -152,6 +152,15 @@ function stateModelFactory(configSchema: AnyConfigurationSchemaType) { tag, } }, + /** + * #action + * overrides base from SharedLinearPileupDisplay to make sortReady false + * since changing feature height destroys the sort-induced layout + */ + setFeatureHeight(n?: number) { + self.sortReady = false + self.featureHeight = n + }, })) .actions(self => { // resets the sort object and refresh whole display on reload