Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix links
  • Loading branch information
aaronrobertshaw committed Mar 28, 2022
commit f107a6389b8cd44a2b1afc34c7ecf485453bf006
4 changes: 2 additions & 2 deletions packages/components/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ In non-WordPress projects, link to the `build-style/style.css` file directly, it

### Popovers and Tooltips

By default, the [`Popover`](https://github.com/WordPress/gutenberg/blob/trunk/packages/components/src/popover/README.md) component will render inline i.e. within its
By default, the [`Popover`](/packages/components/src/popover/README.md) component will render inline i.e. within its
parent to which it should anchor. Depending upon the context in which the
`Popover` is being consumed, this might lead to incorrect positioning. For
example, when being nested within another popover.

This issue can be solved by rendering popovers to a specific location in the DOM via the
`Popover.Slot`. For this to work, you will need your use of the `Popover`
component and its `Slot` to be wrapped in a [`SlotFill`](https://github.com/WordPress/gutenberg/blob/trunk/packages/components/src/slot-fill/README.md) provider.
component and its `Slot` to be wrapped in a [`SlotFill`](/packages/components/src/slot-fill/README.md) provider.

A `Popover` is also used as the underlying mechanism to display `ToolTip` components.
So the same considerations should be applied to them.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const MyBorderBoxControl = () => {
};
```

To [ensure `ToolTip` positioning](https://github.com/WordPress/gutenberg/blob/trunk/packages/components/README.md#popovers-and-tooltips)
To [ensure `ToolTip` positioning](/packages/components/README.md#popovers-and-tooltips)
for the `BorderBoxControl`'s color swatches, render your `BorderBoxControl` with
a `Popover.Slot` further up the element tree and within a
`SlotFillProvider` overall.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const MyBorderControl = () => {
};
```

To [ensure `ToolTip` positioning](https://github.com/WordPress/gutenberg/blob/trunk/packages/components/README.md#popovers-and-tooltips)
To [ensure `ToolTip` positioning](/packages/components/README.md#popovers-and-tooltips)
for the `BorderControl`'s color swatches, render your `BorderControl` with a
`Popover.Slot` further up the element tree and within a
`SlotFillProvider` overall.
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/color-palette/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@ const MyColorPalette = () => {
} );
```

To [ensure `ToolTip` positioning](https://github.com/WordPress/gutenberg/blob/trunk/packages/components/README.md#popovers-and-tooltips)
To [ensure `ToolTip` positioning](/packages/components/README.md#popovers-and-tooltips)
when hovering the `ColorPalette`'s swatches, render your `ColorPalette` with a
`Popover.Slot` further up the element tree and within a `SlotFillProvider` overall.