Skip to content

Commit 55b78f4

Browse files
committed
Misc secondaryInput enhancements
- show secondary input automatically if `mode` is set that way - remove double form control layout wrapper - fix clear icon not correctly stacking with invalid icon (needs to be passed to form control layout) - allow compressed state of input to be controlled when `display` is inline, otherwise default to compressed
1 parent 8254b86 commit 55b78f4

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

packages/eui/src/components/color_picker/color_picker.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,9 @@ export const EuiColorPicker: FunctionComponent<EuiColorPickerProps> = ({
452452
}
453453
};
454454

455-
const inlineInput = secondaryInputDisplay !== 'none' && (
455+
const showSecondaryInput =
456+
mode === 'secondaryInput' || secondaryInputDisplay !== 'none';
457+
const inlineInput = showSecondaryInput && (
456458
<EuiFormRow
457459
display="rowCompressed"
458460
isInvalid={isInvalid}
@@ -465,10 +467,13 @@ export const EuiColorPicker: FunctionComponent<EuiColorPickerProps> = ({
465467
: undefined
466468
}
467469
readOnly={readOnly}
468-
compressed={true}
470+
isDisabled={disabled}
471+
isInvalid={isInvalid}
472+
compressed={display === 'inline' ? compressed : true}
469473
>
470474
<EuiFieldText
471-
compressed={true}
475+
controlOnly={true}
476+
compressed={display === 'inline' ? compressed : true}
472477
value={color ? color.toUpperCase() : HEX_FALLBACK}
473478
placeholder={!color ? placeholder || transparent : undefined}
474479
onChange={handleColorInput}

0 commit comments

Comments
 (0)