-
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
A few quick fixes #2585
A few quick fixes #2585
Conversation
- Consider how `hasChildLabel` is handled since it seems to be set to the opposite
And compressed to DisplayToggles
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.
Tested locally and everything looks good! 👍
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.
EuiSwitch
changes LGTM assuming there was no a11y reason <p>
was used originally.
@myasonik would have the answer
Yeah, that does sound backwards. My bad... Potentially bigger than you want to tackle in this PR but I also wrote up #2493 a little while ago because I think the whole API could be improved/cleaned up a little more. |
Thanks @myasonik , yeah I just wanted to make sure I was understanding correctly. I'll keep that for a later date. What are your thoughts on the |
Technically, yes. But... I wasn't going to say anything because I don't think there's a meaningful, practical impact with the current situation. With the |
Great, thanks for the explanation. We can revisit a |
Jenkins, test this |
EuiSwitch
Replaced
<p>
tag surrounding the label with a<span>
tag.There were instances where the switch could be a child of EuiText which would then add margin to the bottom of
p
tag and cause alignment issues. Instead of trying to override any unwanted styles applied top
tags because of EuiText, it was easiest just to replace with aspan
which is also block-level more similar to alabel
which is what it's replacing.Before
![Screen Shot 2019-11-28 at 1 31 47 PM](https://user-images.githubusercontent.com/549577/70004356-02579b80-1534-11ea-8b29-cfa8f39349dd.png)
After
![Screen Shot 2019-11-28 at 1 32 33 PM](https://user-images.githubusercontent.com/549577/70004361-04b9f580-1534-11ea-8e77-502bc9728528.png)
Fixed layout if the label wrapped to more lines
Using
display: inline-flex
this keeps the label in its own column and keeps the toggle at the top similar to the wrapping of checkboxes. IE lays it out fine too.Before
![Screen Shot 2019-12-02 at 12 24 00 PM](https://user-images.githubusercontent.com/549577/70004420-316e0d00-1534-11ea-8d9c-c4e830e9992e.png)
After
![Screen Shot 2019-12-02 at 12 23 02 PM](https://user-images.githubusercontent.com/549577/70004423-33d06700-1534-11ea-8c1f-b8bf6672ec57.png)
![Screen Shot 2019-12-02 at 12 25 23 PM](https://user-images.githubusercontent.com/549577/70004440-4b0f5480-1534-11ea-967e-8bffff250b07.png)
Question
There's a new prop for EuiFormRow that is called
hasChildLabel
. What it does is removes thefor
attribute from the label so that when used with EuiSwitch, there isn't two labels associated with the switch. However, as I was trying to understand the prop, I think the value is set backwards.I would think that
hasChildLabel = true
means that the form row's child has a label so it should remove the form row's reference. When in facthasChildLabel = false
will remove the reference.@myasonik Maybe you can shed some light? I would assume when adding a switch which has a label, one would add
hasChildLabel = true
to the EuiFormRow.EuiSelectable
Add the same padding from EuiSelectableListItem to the header
I noticed in a Maps configuration where they had EuiSelectable with headers inside a popover, that the header was far left and butting right up against the popover edge.
This PR just adds the same full padding to the whole heading as it does the item so they line up correctly.
Checklist
[ ] Added documentation examples[ ] Checked for breaking changes and labeled appropriately[ ] Checked for accessibility including keyboard-only and screenreader modes