Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update quickstarts docs with common issues #1931

Merged
merged 1 commit into from
Nov 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions packages/docs/pages/quickstarts/common-issues.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Common issues with quickstarts

## Fixing modals that overlay quickstarts

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.

For example,
```jsx
const appendTo = React.useMemo(() => document.querySelector('.pf-c-page.chr-c-page'), []);

return (
<Modal isOpen modalVariant={ModalVariant.large} hasNoBodyWrapper appendTo={appendTo} showClose={false}></Modal>
);
```

If you have, say, a `<Wizard />` that's being returned, you can simply wrap it with the `appendTo` modal,

```jsx
const appendTo = React.useMemo(() => document.querySelector('.pf-c-page.chr-c-page'), []);

return (
<Modal isOpen modalVariant={ModalVariant.large} hasNoBodyWrapper appendTo={appendTo} showClose={false}>
<Wizard />
</Modal>
);
```

Use [this PR](https://github.com/RedHatInsights/sources-ui/pull/1076/files) as reference for appending the model to the correct element.