Skip to content

Commit 8ac920a

Browse files
committed
update quickstarts docs with common issues
1 parent ae56fb3 commit 8ac920a

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Common issues with quickstarts
2+
3+
## Fixing modals that overlay quickstarts
4+
5+
By default, modals will be appended to the root which interferes (z-axis shenanigans) with the quickstarts drawer rendering them useless. To get around this, we'll use the `appendTo` prop for our modals by appending it to `pf-c-page.chr-c-page` instead of the root.
6+
7+
For example,
8+
```jsx
9+
const appendTo = React.useMemo(() => document.querySelector('.pf-c-page.chr-c-page'), []);
10+
11+
return (
12+
<Modal isOpen modalVariant={ModalVariant.large} hasNoBodyWrapper appendTo={appendTo} showClose={false}></Modal>
13+
);
14+
```
15+
16+
If you have, say, a `<Wizard />` that's being returned, you can simply wrap it with the `appendTo` modal,
17+
18+
```jsx
19+
const appendTo = React.useMemo(() => document.querySelector('.pf-c-page.chr-c-page'), []);
20+
21+
return (
22+
<Modal isOpen modalVariant={ModalVariant.large} hasNoBodyWrapper appendTo={appendTo} showClose={false}>
23+
<Wizard />
24+
</Modal>
25+
);
26+
```
27+
28+
Use [this PR](https://github.com/RedHatInsights/sources-ui/pull/1076/files) as reference for appending the model to the correct element.

0 commit comments

Comments
 (0)