Skip to content

Commit 821a42a

Browse files
authored
Merge pull request #25 from starwit/bugfix/AB#1111-Sidebar-lists-do-not-expand-/-scroll-with-many-items
Bugfix/ab#1111 sidebar lists do not expand / scroll with many items
2 parents f3643ef + ef4c0f1 commit 821a42a

File tree

9 files changed

+21
-21
lines changed

9 files changed

+21
-21
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
### [5.0.6-0](https://github.com/starwit/react-image-annotate/compare/5.0.5...5.0.6-0) (2024-03-27)
6+
57
### [5.0.5](https://github.com/starwit/react-image-annotate/compare/5.0.4...5.0.5) (2024-03-21)
68

79
### [5.0.4](https://github.com/starwit/react-image-annotate/compare/5.0.2-1...5.0.4) (2024-03-20)

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@starwit/react-image-annotate",
3-
"version": "5.0.5",
3+
"version": "5.0.6-0",
44
"private": false,
55
"type": "module",
66
"files": [

src/ClassSelectionMenu/index.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ export const ClassSelectionMenu = ({
8080
subTitle=""
8181
icon={<BallotIcon style={{color: muiColors.grey[700]}} />}
8282
expandedByDefault
83+
noScroll={true}
8384
>
8485
{regionClsList.map((label, index) => (
8586
<LabelContainer

src/HistorySidebarBox/index.jsx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// @flow
22

3-
import React, {memo} from "react"
4-
import {createTheme, styled, ThemeProvider} from "@mui/material/styles"
3+
import React, { memo } from "react"
4+
import { createTheme, styled, ThemeProvider } from "@mui/material/styles"
55
import SidebarBoxContainer from "../SidebarBoxContainer"
66
import HistoryIcon from "@mui/icons-material/History"
77
import List from "@mui/material/List"
@@ -11,9 +11,9 @@ import IconButton from "@mui/material/IconButton"
1111
import ListItemSecondaryAction from "@mui/material/ListItemSecondaryAction"
1212
import UndoIcon from "@mui/icons-material/Undo"
1313
import moment from "moment"
14-
import {grey} from "@mui/material/colors"
14+
import { grey } from "@mui/material/colors"
1515
import isEqual from "lodash/isEqual"
16-
import {useTranslation} from "react-i18next"
16+
import { useTranslation } from "react-i18next"
1717

1818
const theme = createTheme()
1919
const EmptyTextDiv = styled('div')(() => ({
@@ -24,28 +24,29 @@ const EmptyTextDiv = styled('div')(() => ({
2424
padding: 20,
2525
}))
2626

27-
const listItemTextStyle = {paddingLeft: 16}
27+
const listItemTextStyle = { paddingLeft: 16 }
2828

2929
export const HistorySidebarBox = ({
3030
history,
3131
onRestoreHistory,
3232
}) => {
3333

34-
const {t} = useTranslation();
34+
const { t } = useTranslation();
3535

3636
return (
3737
<ThemeProvider theme={theme}>
3838
<SidebarBoxContainer
3939
title={t("menu.history")}
40-
icon={<HistoryIcon style={{color: grey[700]}} />}
40+
icon={<HistoryIcon style={{ color: grey[700] }} />}
4141
expandedByDefault
42+
noScroll={true}
4243
>
4344
<List>
4445
{history.length === 0 && (
4546
<EmptyTextDiv>{t("no.history")}</EmptyTextDiv>
4647
)}
47-
{history.map(({name, time}, i) => (
48-
<ListItem button dense key={i}>
48+
{history.map(({ name, time }, i) => (
49+
<ListItem button dense key={i} >
4950
<ListItemText
5051
style={listItemTextStyle}
5152
primary={name}

src/RegionSelectorSidebarBox/index.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ export const RegionSelectorSidebarBox = ({
180180
subTitle=""
181181
icon={<RegionIcon style={{color: grey[700]}} />}
182182
expandedByDefault
183+
noScroll={true}
183184
>
184185
<ContainerDiv>
185186
<MemoRowHeader />

src/SidebarBoxContainer/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ export const SidebarBoxContainer = ({
1010
title,
1111
subTitle,
1212
children,
13-
noScroll = false,
13+
noScroll,
1414
expandedByDefault = false,
1515
}) => {
1616
return (
1717
<ThemeProvider theme={theme}>
18-
<SidebarBox icon={icon} title={title}>
18+
<SidebarBox icon={icon} title={title} noScroll={noScroll}>
1919
{children}
2020
</SidebarBox>
2121
</ThemeProvider>

src/workspace/SidebarBox/index.jsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// @flow
22

33
import React, { useState, memo, useCallback } from "react"
4-
import Paper from "@mui/material/Paper"
54
import { createTheme, styled, ThemeProvider } from "@mui/material/styles"
65
import ExpandIcon from "@mui/icons-material/ExpandMore"
76
import IconButton from "@mui/material/IconButton"
@@ -37,7 +36,7 @@ export const SidebarBox = ({
3736
title,
3837
subTitle,
3938
children,
40-
noScroll = false,
39+
noScroll,
4140
expandedByDefault,
4241
}) => {
4342
const content = (
@@ -88,7 +87,7 @@ export const SidebarBox = ({
8887
<Collapse in={expanded} >
8988
<div
9089
className="panel"
91-
style={{ display: "block", overflow: "hidden", height: 200 }}
90+
style={{ display: "block", overflow: "hidden", height: 300 }}
9291
>
9392
{content}
9493
</div>

src/workspace/SidebarBox/styles.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,5 @@ export default {
5050
expandedContent: {
5151
maxHeight: 300,
5252
overflowY: "auto",
53-
"&.noScroll": {
54-
overflowY: "visible",
55-
overflow: "visible",
56-
},
5753
},
5854
}

0 commit comments

Comments
 (0)