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

[EuiCard] card's children is an escape hatch but description is still required #4546

Closed
chandlerprall opened this issue Feb 18, 2021 · 8 comments

Comments

@chandlerprall
Copy link
Contributor

EuiCard's Custom children example states

In the event that you need more than just paragraph text for the description, you can pass anything you need as the children of the component.

but even in that case, description is always required. There's an additional complication where, if you want the card's description to be a single block-level element, the entire content must be passed as children and nothing provided to description, as everything in description is wrapped in EuiText>p, and React console.warn's about invalid DOM nesting.

description's type definition includes boolean - mostly by accident - so passing description={false} effectively skirts the issue but the EuiText>p is still rendered with empty content. We should add a quick conditional around that rendering to better support this use case.

@cchaos
Copy link
Contributor

cchaos commented Feb 18, 2021

This is something that I have fought with for a long time. This first sentence in the docs has been up there since the creation of EuiCard and was to set the tone for what a card is:

At its core an EuiCard should contain a title,description, and an icon.

And in a similar vein, the sentence that you copied says:

In the event that you need more than just paragraph text for the description,

Means, that a description (rendering as paragraph text) is still required.

But I guess I give up and we'll just need to mark description as optional.

@patelaryan7751
Copy link

patelaryan7751 commented Feb 20, 2021

can i work on this issue? @chandlerprall

@chandlerprall
Copy link
Contributor Author

@patelaryan7751 go ahead; any issue not assigned + doesn't have a comment with someone actively working on it is free to take on!

@hetanthakkar
Copy link
Contributor

@patelaryan7751 you still working on this issue?

@patelaryan7751
Copy link

@patelaryan7751 you still working on this issue?

i am busy with acads yaa you can work

hetanthakkar added a commit to hetanthakkar/eui that referenced this issue Feb 25, 2021
@hetanthakkar
Copy link
Contributor

@chandlerprall I have submitted a PR for this issue. Could you please review it!

@hetanthakkar
Copy link
Contributor

@myasonik I've made the required changes could you please check

@cchaos
Copy link
Contributor

cchaos commented Mar 16, 2021

Closed by #4582

@cchaos cchaos closed this as completed Mar 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants