File tree 3 files changed +7
-1
lines changed
protocol-designer/src/pages/Designer/ProtocolSteps/Timeline
3 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -294,6 +294,7 @@ export function StepContainer(props: StepContainerProps): JSX.Element {
294
294
confirmDelete = { confirmDelete }
295
295
confirmMultiDelete = { confirmMultiDelete }
296
296
multiSelectItemIds = { multiSelectItemIds }
297
+ sidebarWidth = { sidebarWidth }
297
298
/> ,
298
299
getMainPagePortalEl ( )
299
300
)
Original file line number Diff line number Diff line change @@ -41,8 +41,11 @@ interface StepOverflowMenuProps {
41
41
confirmDelete : ( ) => void
42
42
confirmMultiDelete : ( ) => void
43
43
multiSelectItemIds : string [ ] | null
44
+ sidebarWidth : number // adjust the position of the overflow menu
44
45
}
45
46
47
+ const POSITION_ADJUSTMENT = 4
48
+
46
49
export function StepOverflowMenu ( props : StepOverflowMenuProps ) : JSX . Element {
47
50
const {
48
51
stepId,
@@ -53,6 +56,7 @@ export function StepOverflowMenu(props: StepOverflowMenuProps): JSX.Element {
53
56
confirmDelete,
54
57
confirmMultiDelete,
55
58
multiSelectItemIds,
59
+ sidebarWidth,
56
60
} = props
57
61
const { t } = useTranslation ( 'protocol_steps' )
58
62
const singleEditFormHasUnsavedChanges = useSelector (
@@ -101,7 +105,7 @@ export function StepOverflowMenu(props: StepOverflowMenuProps): JSX.Element {
101
105
ref = { menuRootRef }
102
106
zIndex = { 12 }
103
107
top = { top }
104
- left = "18.75rem"
108
+ left = { sidebarWidth - POSITION_ADJUSTMENT } // the space between kebab menu button and overflow menu is 8px
105
109
position = { POSITION_ABSOLUTE }
106
110
whiteSpace = { NO_WRAP }
107
111
borderRadius = { BORDERS . borderRadius8 }
Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ describe('StepOverflowMenu', () => {
67
67
handleEdit : vi . fn ( ) ,
68
68
confirmDelete : mockConfirm ,
69
69
confirmMultiDelete : vi . fn ( ) ,
70
+ sidebarWidth : 235 ,
70
71
}
71
72
vi . mocked ( getMultiSelectItemIds ) . mockReturnValue ( null )
72
73
vi . mocked ( getCurrentFormIsPresaved ) . mockReturnValue ( false )
You can’t perform that action at this time.
0 commit comments