-
Notifications
You must be signed in to change notification settings - Fork 842
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
Remove EuiFlexGroup dependency from EuiAccordion #2143
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think approach is good and looks fine on the code side. Anytime we change flex though I think it's smart to test further downstream. Let's make sure we run this in Kibana and checking some known usages before merging.
I checked this in current instances of EuiAccordion in Kibana as well as @maryia-lapata's PR. All the current instances are good, and so is the PR with some tweaking of the button content. |
4f663e8
to
92282d5
Compare
className={buttonClasses} | ||
type="button"> | ||
<span className="euiAccordion__iconWrapper">{icon}</span> | ||
<span className={buttonContentClasses}>{buttonContent}</span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The buttonContentClasses
contains the buttonContentClassName
prop and euiAccordion__buttonContent
class, which I can't find in the existing styles. Could we get rid of buttonContentClassName
at all since we can pass a buttonContent
node with already applied class ? And also get rid of redundant buttonContentClasses
variable ..
<span className={buttonContentClasses}>{buttonContent}</span> | |
{buttonContent} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see your point about the class .euiAccordion__buttonContent
not being used in any SASS, I can remove that class. However, we need to keep buttonContentClassName
because as a consumer, you can't target that inner span wihout overriding a .eui
class.
So we're providing a way to target that exact span, which needs to happen if you need to truncate the text, as is shown in this example:
buttonContentClassName="eui-textTruncate" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is a benefit of providing a className for a node which I also provide manually? That means I could pass the buttonContent
prop as node : <span className="eui-textTruncate">My very very very long text is here</span>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because not all consumers know to do it that way, haha
Co-Authored-By: Daniil Suleiman <[email protected]>
retest |
jenkins, test this |
Based on the issues stemming from negative margins and all the different options from EuiFlexGroup and wild nesting, I've removed this dependency for just applying
display: flex
in CSS.Ref: #2141
Fixes the failed responsiveness when using the
extraAction
propI also added an example of how to truncate the text properly
cc @sulemanof @maryia-lapata
Checklist
[ ] This was checked for breaking changes and labeled appropriately[ ] This was checked against keyboard-only and screenreader scenarios[ ] This required updates to Framer X components