Skip to content

Commit

Permalink
Remove other example links and use built-in Chakra Z indices for port…
Browse files Browse the repository at this point in the history
…al examples
  • Loading branch information
csandman committed Dec 17, 2024
1 parent 7a52310 commit e7d8542
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ This component is a wrapper for the popular react component

Check out the demo here:

[![SB-TS]](https://stackblitz.com/edit/vitejs-vite-lzaqwr?file=src%2Fapp.tsx)
[![SB-TS]](https://stackblitz.com/edit/hrqv9vlv?file=src%2Fapp.tsx)

> [!NOTE]
>
Expand Down Expand Up @@ -532,8 +532,6 @@ const chakraStyles = {
};
```

[![SB-TS]](https://stackblitz.com/edit/vitejs-vite-o6ugku?file=src%2Fapp.tsx)

Additionally, there is one key that is available in the `styles` prop that does
not exist in the `chakraStyles` object; `menuPortal`. This key applies to the
`MenuPortal` element which is only used when the
Expand All @@ -553,7 +551,11 @@ return (
<Select
menuPortalTarget={document.body}
styles={{
menuPortal: (provided) => ({ ...provided, zIndex: 100 }),
menuPortal: (provided) => ({
...provided,
// This is the z-index of the normal select in Chakra.
zIndex: "var(--chakra-z-index-dropdown)",
}),
}}
chakraStyles={{
// All other component styles
Expand Down Expand Up @@ -581,7 +583,7 @@ return (
/* styles.css */

.crs__menu-portal {
z-index: 100;
z-index: var(--chakra-z-index-dropdown);
}
```

Expand All @@ -590,12 +592,6 @@ component, please leave a comment on
[this issue](https://github.com/csandman/chakra-react-select/issues/55) or
submit a pull request.

#### Examples

Dropdown menu attached to control example:

[![SB-TS]](https://stackblitz.com/edit/vitejs-vite-nh58wg?file=src%2Fapp.tsx)

### Theme Styles

As mentioned above, a few of the custom components this package implements
Expand Down

0 comments on commit e7d8542

Please sign in to comment.