Skip to content

Commit

Permalink
Fix long combo box items breaking out of flex item width (#73351) (#7…
Browse files Browse the repository at this point in the history
…3524)

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
jen-huang and elasticmachine authored Jul 28, 2020
1 parent 3c6202f commit e72d17c
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
import React, { useState, Fragment, memo, useMemo } from 'react';
import styled from 'styled-components';
import { FormattedMessage } from '@kbn/i18n/react';
import {
EuiFlexGrid,
Expand All @@ -21,6 +22,10 @@ import {
} from '../services';
import { PackageConfigInputVarField } from './package_config_input_var_field';

const FlexItemWithMaxWidth = styled(EuiFlexItem)`
max-width: calc(50% - ${(props) => props.theme.eui.euiSizeL});
`;

export const PackageConfigInputConfig: React.FunctionComponent<{
packageInputVars?: RegistryVarsEntry[];
packageConfigInput: PackageConfigInput;
Expand Down Expand Up @@ -88,7 +93,7 @@ export const PackageConfigInputConfig: React.FunctionComponent<{
</EuiFlexItem>
</EuiFlexGroup>
</EuiFlexItem>
<EuiFlexItem>
<FlexItemWithMaxWidth>
<EuiFlexGroup direction="column" gutterSize="m">
{requiredVars.map((varDef) => {
const { name: varName, type: varType } = varDef;
Expand Down Expand Up @@ -176,7 +181,7 @@ export const PackageConfigInputConfig: React.FunctionComponent<{
</Fragment>
) : null}
</EuiFlexGroup>
</EuiFlexItem>
</FlexItemWithMaxWidth>
</EuiFlexGrid>
);
}
Expand Down

0 comments on commit e72d17c

Please sign in to comment.