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

data attribute is not applied to elements created from components that are not accessed directly #48

Open
LoganDark opened this issue Jul 25, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@LoganDark
Copy link

LoganDark commented Jul 25, 2021

Basically, this

<HDialog open={open} static onClose={onClose} className="dialog">
	<HDialog.Overlay className="dialog-overlay" />
	<HDialog.Title className="dialog-title">{title}</HDialog.Title>
	<HDialog.Description className="dialog-description">{description}</HDialog.Description>
	{children}
</HDialog>

does not work, but this

const Overlay = HDialog.Overlay
const Title = HDialog.Title
const Description = HDialog.Description
const dialog = <HDialog open={open} static onClose={onClose} className="dialog">
	<Overlay className="dialog-overlay" />
	<Title className="dialog-title">{title}</Title>
	<Description className="dialog-description">{description}</Description>
	{children}
</HDialog>

does.

This has led to false bug reports like tailwindlabs/headlessui#696 because I didn't take it into a debugger and closely inspect the props being passed down

@gaoxiaoliangz gaoxiaoliangz added the bug Something isn't working label Jul 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants