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

Set the correct min-width for the ChromePicker popover #6863

Merged
merged 3 commits into from May 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions components/color-palette/index.js
Expand Up @@ -47,7 +47,7 @@ export default function ColorPalette( { colors, disableCustomColors = false, val
{ ! disableCustomColors &&
<Dropdown
className="components-color-palette__item-wrapper components-color-palette__custom-color"
contentClassName="components-color-palette__picker "
contentClassName="components-color-palette__picker"
renderToggle={ ( { isOpen, onToggle } ) => (
<Tooltip text={ customColorPickerLabel }>
<button
Expand All @@ -65,7 +65,6 @@ export default function ColorPalette( { colors, disableCustomColors = false, val
<ChromePicker
color={ value }
onChangeComplete={ ( color ) => onChange( color.hex ) }
style={ { width: '100%' } }
disableAlpha
/>
) }
Expand Down
5 changes: 5 additions & 0 deletions components/color-palette/style.scss
Expand Up @@ -144,3 +144,8 @@ $color-palette-circle-spacing: 14px;

background-clip: content-box, content-box, content-box, content-box, content-box, content-box, padding-box, padding-box, padding-box, padding-box, padding-box, padding-box;
}

.components-color-palette__picker:not(.is-mobile) .components-popover__content {
// ChromePicker has a hardcoded width of 225px, so we need to override the popover min-width.
min-width: 225px;
}
9 changes: 2 additions & 7 deletions components/color-palette/test/__snapshots__/index.js.snap
Expand Up @@ -32,11 +32,6 @@ exports[`ColorPalette Dropdown .renderContent should render dropdown content 1`]
"r": 255,
}
}
style={
Object {
"width": "100%",
}
}
/>
`;

Expand All @@ -57,7 +52,7 @@ exports[`ColorPalette Dropdown .renderToggle should render dropdown content 1`]
exports[`ColorPalette Dropdown should render it correctly 1`] = `
<Dropdown
className="components-color-palette__item-wrapper components-color-palette__custom-color"
contentClassName="components-color-palette__picker "
contentClassName="components-color-palette__picker"
renderContent={[Function]}
renderToggle={[Function]}
/>
Expand Down Expand Up @@ -209,7 +204,7 @@ exports[`ColorPalette should render a dynamic toolbar of colors 1`] = `
</div>
<Dropdown
className="components-color-palette__item-wrapper components-color-palette__custom-color"
contentClassName="components-color-palette__picker "
contentClassName="components-color-palette__picker"
renderContent={[Function]}
renderToggle={[Function]}
/>
Expand Down