Skip to content

Ensure [hidden] works as expected - #4873

Merged
adamwathan merged 1 commit into
masterfrom
fix-hidden
Jul 2, 2021
Merged

Ensure [hidden] works as expected#4873
adamwathan merged 1 commit into
masterfrom
fix-hidden

Conversation

@adamwathan

Copy link
Copy Markdown
Member

Resolves #4872.

This PR makes sure that the expected behavior of the [hidden] attribute is preserved even on elements where we override the default display value, like images, videos, iframes, etc.

@adamwathan
adamwathan merged commit a323030 into master Jul 2, 2021
@adamwathan
adamwathan deleted the fix-hidden branch July 2, 2021 13:14
@andresgutgon

andresgutgon commented Dec 7, 2021

Copy link
Copy Markdown

Hi, I have said this before and say it again. AWESOME project. I love it. I'm a customer xD

Ok let's go to my issue 😅

Is this the expected behavior?
image

So I see [hidden] style applied but if I have a display class like .flex it's overwritten.

I can fix on my part easily like this:

.hidden-attribute[hidden] {
  @apply hidden;
}

But I love Tailwind and I hate write CSS

@andresgutgon

andresgutgon commented Dec 7, 2021

Copy link
Copy Markdown

I guess this could be a variant like this?

const FancyReactComponent = ({ hidden }) => {return (<div className="flex:not([hidden])" hidden={hidden}>I'm hidden now</div>
}

I know I could do this with CSS classes. But in my use case I don't control the React component, just the CSS so the react component use hidden attribute

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[hidden] attribute ignored on certain elements

2 participants