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

CSS generation not working properly in shadow DOM with Emotion cache enabled #5694

Closed
goldmont opened this issue Jul 5, 2023 · 1 comment
Labels
issue/bug-unconfirmed Issues that describe a bug that hasn't been confirmed by a maintainer yet

Comments

@goldmont
Copy link

goldmont commented Jul 5, 2023

Are you reporting a bug or runtime error?

Select behaves strangely while applying custom style even though I use Emotion cache.

Issue description

I'm using this library in two different projects, the latter is a clone of the former. Both of them are using a shadow DOM.

In my tests I used the following code (no customizations):

index file:

const shadowrootCache = createCache({
	key: 'shadowroot-cache',
	container: domElement
});

const Root = () => (
	<CacheProvider value={shadowrootCache}>
		<App/>
	</CacheProvider>
);

ReactDOM.render(<Root/>, domElement);

Select component:

<Select
	options={[
		{ label: 'Test', value: 'test' },
		{ label: 'Test 2', value: 'test-2' },
		{ label: 'Test 3', value: 'test-3' }
	]}
/>

In the first project, the Select component looks the same as the one in the storybook:

image

In the second project, the layout is broken:

image

Furthermore, aria-live messages are visible in the second project but not in the first one. In which case is it working properly? I want to disable them.

However, only in the second project, the CSS is missing at all. The class names are set in the class attributes but the classes themselves don't exist. Very strange.

First project (CSS classes exist):

image

Second project (CSS classes don't exist):

image

Hoping in a prompt reply. I need your help to solve this issue. Thanks.

@goldmont goldmont added the issue/bug-unconfirmed Issues that describe a bug that hasn't been confirmed by a maintainer yet label Jul 5, 2023
@goldmont
Copy link
Author

goldmont commented Jul 6, 2023

UPDATE:

To anyone something similar is happening, here I posted a workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue/bug-unconfirmed Issues that describe a bug that hasn't been confirmed by a maintainer yet
Projects
None yet
Development

No branches or pull requests

1 participant