Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Commit 82097b3

Browse files
Merge pull request #325 from chakra-ui/fix/input-group-z-index
fix(inputgroup): default inputgroup z-index to containing element zindex
2 parents 15a27c1 + 1072855 commit 82097b3

File tree

5 files changed

+77
-4
lines changed

5 files changed

+77
-4
lines changed

packages/chakra-ui-core/src/CInputGroup/CInputGroup.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ const CInputGroup = {
8787
attrs: {
8888
display: 'flex',
8989
position: 'relative',
90+
zIndex: 0,
9091
...data.attrs,
9192
'data-chakra-component': 'CInputGroup'
9293
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { CInputGroup, CInputLeftElement, CInputRightElement, CInput, CIcon } from '../..'
2+
import { render } from '@/tests/test-utils'
3+
4+
const renderComponent = (props) => {
5+
const base = {
6+
data: () => ({ text: 'hello' }),
7+
components: { CInputGroup, CInputLeftElement, CInputRightElement, CInput, CIcon },
8+
template: `
9+
<c-input-group>
10+
<c-input-left-element color="gray.300" fontSize="1.2em">¥</c-input-left-element>
11+
<c-input placeholder="Enter amount" />
12+
<c-input-right-element><c-icon name="check" color="green.500" /></c-input-right-element>
13+
</c-input-group>
14+
`,
15+
...props
16+
}
17+
return render(base)
18+
}
19+
20+
test('should render correctly', () => {
21+
const { asFragment } = renderComponent()
22+
expect(asFragment()).toMatchSnapshot()
23+
})
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`should render correctly 1`] = `
4+
<DocumentFragment>
5+
<div
6+
class="css-15frdhg"
7+
data-chakra-component="CInputGroup"
8+
>
9+
<div
10+
class="css-rbouvx"
11+
color="gray.300"
12+
data-chakra-component="CInputLeftElement"
13+
fontsize="1.2em"
14+
>
15+
¥
16+
</div>
17+
<input
18+
class="css-lr9hjy"
19+
data-chakra-component="CInput"
20+
placeholder="Enter amount"
21+
/>
22+
<div
23+
class="css-wqp70x"
24+
data-chakra-component="CInputRightElement"
25+
>
26+
<svg
27+
class="css-12j51pv css-3vopgu css-7w9hf9"
28+
data-chakra-component="CIcon"
29+
role="presentation"
30+
viewBox="0 0 14 14"
31+
>
32+
33+
34+
<g
35+
fill="currentColor"
36+
>
37+
38+
39+
<polygon
40+
points="5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"
41+
/>
42+
43+
44+
</g>
45+
46+
47+
</svg>
48+
</div>
49+
</div>
50+
</DocumentFragment>
51+
`;

website/components/MDXComponents.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ const MDXComponents = {
109109
name: 'InlineCode',
110110
render () {
111111
return (
112-
<CCode variant-color="orange" font-weight="bold" px="1" rounded="md" fontSize="0.84em" {...props}>
112+
<CCode variant-color="orange" bg="transparent" font-weight="bold" px="1" rounded="md" fontSize="0.84em" {...props}>
113113
{this.$slots.default}
114114
</CCode>
115115
)

website/layouts/default.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,9 @@ export default {
103103
},
104104
code: {
105105
light: {
106-
bg: 'orange.100',
107-
color: 'orange.800'
106+
color: 'orange.600'
108107
},
109108
dark: {
110-
bg: 'rgba(250, 240, 137, 0.16)',
111109
color: 'rgb(250, 195, 137)'
112110
}
113111
},

0 commit comments

Comments
 (0)