Skip to content

Commit d5c9108

Browse files
authored
fix: Parts of elements appear above the Modal actions area when scrolling (#575)
1 parent 45e7822 commit d5c9108

File tree

2 files changed

+21
-24
lines changed

2 files changed

+21
-24
lines changed

src/components/Modal.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ const ModalContentSC = styled.div<{
8888
$scrollable: boolean
8989
$hasActions: boolean
9090
}>(({ theme, $scrollable, $hasActions }) => ({
91+
position: 'relative',
92+
zIndex: 0,
9193
margin: theme.spacing.large,
9294
marginBottom: $hasActions ? 0 : theme.spacing.large,
9395
...theme.partials.text.body1,

src/stories/Modal.stories.tsx

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { Div, H3, P } from 'honorable'
1+
import { Div, Flex, H3, P } from 'honorable'
22
import { useState } from 'react'
33

44
import styled from 'styled-components'
55

6-
import { Button, Card, Code, FormField, Input, Modal } from '..'
6+
import { Button, Card, Code, FormField, Input2, Modal, SearchIcon } from '..'
77
import { SEVERITIES } from '../components/Modal'
88
import { jsCode } from '../constants'
99

@@ -104,26 +104,18 @@ function Template(args: any) {
104104
)}
105105

106106
{args.form && (
107-
<>
108-
<FormField
109-
marginBottom="medium"
110-
label="Name"
111-
>
112-
<Input value="Admin" />
107+
<Flex
108+
gap="medium"
109+
direction="column"
110+
>
111+
<FormField label="Name">
112+
<Input2 value="Admin" />
113113
</FormField>
114-
115-
<FormField
116-
marginBottom="medium"
117-
label="Description"
118-
>
119-
<Input value="Full account access" />
114+
<FormField label="Description">
115+
<Input2 value="Full account access" />
120116
</FormField>
121-
122-
<FormField
123-
marginBottom="medium"
124-
label="Repository bindings"
125-
>
126-
<Input value="*" />
117+
<FormField label="Repository bindings">
118+
<Input2 value="*" />
127119
</FormField>
128120
<P>
129121
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus
@@ -138,7 +130,10 @@ function Template(args: any) {
138130
interdum, placerat dolor. Pellentesque et semper massa. Aliquam
139131
nec nisl eu nibh fringilla vehicula. Suspendisse a purus quam.
140132
</P>
141-
</>
133+
<FormField label="Repository bindings">
134+
<Input2 startIcon={<SearchIcon />} />
135+
</FormField>
136+
</Flex>
142137
)}
143138
</Modal>
144139
<Card
@@ -247,21 +242,21 @@ function PinnedToTopTemplate(args: any) {
247242
marginBottom="medium"
248243
label="Name"
249244
>
250-
<Input value="Admin" />
245+
<Input2 value="Admin" />
251246
</FormField>
252247

253248
<FormField
254249
marginBottom="medium"
255250
label="Description"
256251
>
257-
<Input value="Full account access" />
252+
<Input2 value="Full account access" />
258253
</FormField>
259254

260255
<FormField
261256
marginBottom="medium"
262257
label="Repository bindings"
263258
>
264-
<Input value="*" />
259+
<Input2 value="*" />
265260
</FormField>
266261
<P>
267262
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus

0 commit comments

Comments
 (0)