Skip to content

Commit

Permalink
[ObsUX] Fix layout in KeyValueFilterList component (elastic#168814)
Browse files Browse the repository at this point in the history
Closes elastic#168129

### What was done

There was a change in `EuiDescriptionList` this component was updated to
use CSS grid, and was the cause of the misalignment, it's been fixed
with the new prop `columnWidths`
Also, the grid was creating a gap between the borders of the title and
description of the list item.
After checking with @boriskirov, we decided to get rid of the border.

BEFORE


![image](https://github.com/elastic/kibana/assets/31922082/fa2fbf54-08b8-4425-b834-504f2c0d7753)

AFTER


![image](https://github.com/elastic/kibana/assets/31922082/03356522-08aa-474e-a3dd-b39eaf19ec25)
  • Loading branch information
MiriamAparicio authored Oct 16, 2023
1 parent caa4028 commit 70d1b26
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ const StyledEuiDescriptionList = styled(EuiDescriptionList)`
`${theme.eui.euiSizeS} ${theme.eui.euiSizeS} 0 ${theme.eui.euiSizeS}`};
.descriptionList__title,
.descriptionList__description {
border-bottom: ${({ theme }) => theme.eui.euiBorderThin};
margin-top: 0;
align-items: center;
display: flex;
Expand Down Expand Up @@ -74,21 +73,21 @@ export function KeyValueFilterList({
buttonContent={<AccordionButtonContent icon={icon} title={title} />}
buttonClassName="buttonContentContainer"
>
<StyledEuiDescriptionList type="column">
<StyledEuiDescriptionList type="column" columnWidths={['20%', '80%']}>
{nonEmptyKeyValueList.map(({ key, value, isFilterable }) => {
return (
<Fragment key={key}>
<EuiDescriptionListTitle
className="descriptionList__title"
style={{ width: '20%', height: '40px' }}
style={{ height: '40px' }}
>
<EuiText size="s" style={{ fontWeight: 'bold' }}>
{key}
</EuiText>
</EuiDescriptionListTitle>
<EuiDescriptionListDescription
className="descriptionList__description"
style={{ width: '80%', height: '40px' }}
style={{ height: '40px' }}
>
<EuiFlexGroup
alignItems="baseline"
Expand Down

0 comments on commit 70d1b26

Please sign in to comment.