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

ColorPalette: Custom color picker is wrong positioned #8558

Closed
mmtr opened this issue Aug 5, 2018 · 1 comment
Closed

ColorPalette: Custom color picker is wrong positioned #8558

mmtr opened this issue Aug 5, 2018 · 1 comment
Labels
[Feature] UI Components Impacts or related to the UI component system [Package] Components /packages/components [Type] Bug An existing feature does not function as intended

Comments

@mmtr
Copy link
Contributor

mmtr commented Aug 5, 2018

Describe the bug
When rendering a ColorPalette component outside Gutenberg, the custom color picker is wrong positioned.

To Reproduce
Execute the code below in a new React project after installing @wordpress/components and @wordpress/compose.

import React from 'react';
import ReactDOM from 'react-dom';
import { ColorPalette } from '@wordpress/components';
import { withState } from '@wordpress/compose';

import '@wordpress/components/build-style/styles.css';

const MyColorPalette = withState( {
	color: '#f00',
} )( ( { color, setState } ) => { 
	const colors = [ 
		{ name: 'red', color: '#f00' }, 
		{ name: 'white', color: '#fff' }, 
		{ name: 'blue', color: '#00f' }, 
	];
	
	return ( 
		<ColorPalette 
			colors={ colors } 
			value={ color }
			onChange={ ( color ) => setState( { color } ) } 
		/>
	) 
} );

ReactDOM.render(
	<MyColorPalette />,
	document.getElementById( 'root' )
);

Expected behavior
The custom color picker should be displayed below the custom color icon.

Screenshots
screen shot 2018-08-05 at 22 37 25

Desktop:

  • OS: macOS High Sierra
  • Browser Chrome
  • Version 67

Additional context
Issue found while working on #8338 and Automattic/wp-calypso#26367

@gziolo gziolo added [Type] Bug An existing feature does not function as intended [Feature] UI Components Impacts or related to the UI component system [Package] Components /packages/components labels Aug 6, 2018
@mtias
Copy link
Member

mtias commented Oct 27, 2018

Closing as duplicate of #8559.

@mtias mtias closed this as completed Oct 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] UI Components Impacts or related to the UI component system [Package] Components /packages/components [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

3 participants