Skip to content

Commit

Permalink
ColorPalette: Add SlotFillProvider to story to correct tooltip positi…
Browse files Browse the repository at this point in the history
…oning (#39674)
  • Loading branch information
aaronrobertshaw authored Mar 23, 2022
1 parent c3a49ad commit c480389
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/components/src/color-palette/stories/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { useState } from '@wordpress/element';
* Internal dependencies
*/
import ColorPalette from '../';
import Popover from '../../popover';
import { Provider as SlotFillProvider } from '../../slot-fill';

const meta = {
title: 'Components/ColorPalette',
Expand Down Expand Up @@ -42,7 +44,12 @@ export default meta;

const Template = ( args ) => {
const [ color, setColor ] = useState( '#f00' );
return <ColorPalette { ...args } value={ color } onChange={ setColor } />;
return (
<SlotFillProvider>
<ColorPalette { ...args } value={ color } onChange={ setColor } />
<Popover.Slot />
</SlotFillProvider>
);
};

export const Default = Template.bind( {} );
Expand Down

0 comments on commit c480389

Please sign in to comment.