Skip to content

Commit 750b2ec

Browse files
authored
[CORE-747] Enable IGV scrolling when tracks are tall (#5452)
1 parent 2731056 commit 750b2ec

File tree

3 files changed

+42
-2
lines changed

3 files changed

+42
-2
lines changed

src/components/igv/IGVBrowser.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,6 @@ const IGVBrowser = ({ selectedFiles, refGenome: { genome, reference }, workspace
484484
{
485485
ref: containerRef,
486486
style: {
487-
overflowY: 'visible',
488487
padding: '10px 0',
489488
margin: 8,
490489
border: `1px solid ${colors.dark(0.25)}`,

src/workspace-data/Data.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ const styles = {
7474
},
7575
tableViewPanel: {
7676
position: 'relative',
77-
overflow: 'hidden',
77+
overflow: 'auto',
7878
width: '100%',
7979
flex: 1,
8080
display: 'flex',

src/workspace-data/Data.test.ts

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,4 +133,45 @@ describe('WorkspaceData', () => {
133133
{ timeout: 10000 }
134134
);
135135
}, 15000);
136+
137+
it('has scrollable tableViewPanel to allow vertical scrolling when content is too tall', async () => {
138+
// Setup mocks for the test
139+
const mockEntityMetadata = jest.fn();
140+
mockEntityMetadata.mockResolvedValue(entityMetadata);
141+
142+
asMockedFn(Workspaces).mockReturnValue({
143+
workspace: (_namespace: string, _name: string) => ({
144+
entityMetadata: mockEntityMetadata,
145+
}),
146+
} as any);
147+
148+
(getIgvUrlParams as jest.Mock).mockReturnValue({
149+
igvSession: null,
150+
igvGenome: null,
151+
});
152+
153+
const workspaceDataProps = {
154+
namespace: 'test-namespace',
155+
name: 'test-name',
156+
workspace: defaultGoogleWorkspace,
157+
refreshWorkspace: () => {},
158+
storageDetails: { ...defaultGoogleBucketOptions },
159+
};
160+
161+
await act(async () => {
162+
render(h(WorkspaceData, workspaceDataProps));
163+
});
164+
165+
await waitFor(() => {
166+
// Find the element with the tableViewPanel styles
167+
// The tableViewPanel should have overflow: 'auto' to enable scrolling
168+
const tableViewPanels = document.querySelectorAll('[style*="overflow"]');
169+
const hasScrollablePanel = Array.from(tableViewPanels).some((el) => {
170+
const style = (el as HTMLElement).style;
171+
return style.overflow === 'auto' || style.overflowY === 'auto';
172+
});
173+
174+
expect(hasScrollablePanel).toBe(true);
175+
});
176+
});
136177
});

0 commit comments

Comments
 (0)