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

Gutenberg: disabled toggle visually broken #28707

Closed
simison opened this issue Nov 20, 2018 · 1 comment
Closed

Gutenberg: disabled toggle visually broken #28707

simison opened this issue Nov 20, 2018 · 1 comment
Assignees
Labels
[Goal] Gutenberg Working towards full integration with Gutenberg [Pri] High [Type] Bug

Comments

@simison
Copy link
Member

simison commented Nov 20, 2018

While building Gutenberg block for Simple Payments, we used disabled toggle component from Gutenberg.

This is how it looked for Calypso:

image

And in wp-admin:

image

The border will be fixed for Gutenberg (WordPress/gutenberg#12091) but that fix will still leave Calypso broken, as demonstrated in #28659 (comment):

screen shot 2018-11-20 at 11 25 47

You can replicate the problem with this block:

/**
 * External dependencies
 */
import { registerBlockType } from '@wordpress/blocks';
import { Disabled, ToggleControl } from '@wordpress/components';
import { Fragment } from '@wordpress/element';
import { InspectorControls } from '@wordpress/editor';

const toggles = (
	<Fragment>
		<Disabled>
			<ToggleControl label="This is disabled" />
		</Disabled>
		<ToggleControl label="This is not disabled" />
	</Fragment>
);

registerBlockType( 'demo/toggle-control', {
	title: 'Toggle Control demo',
	category: 'layout',
	edit: () => (
		<Fragment>
			<InspectorControls>{ toggles }</InspectorControls>
			{ toggles }
		</Fragment>
	),
	save: () => null,
} );

Tracking the fix for Simple payments in wp-admin here: #28659

@kwight
Copy link
Contributor

kwight commented Dec 12, 2018

This must have gotten fixed at some point by something, I can't replicate on wpcalypso nor master:

screen shot 2018-12-12 at 1 38 42 pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Goal] Gutenberg Working towards full integration with Gutenberg [Pri] High [Type] Bug
Projects
None yet
Development

No branches or pull requests

3 participants