Unverified Commit 26ab2b57 authored by gabriellsh's avatar gabriellsh Committed by GitHub
Browse files

fix: Empty space before SelectFiltered placeholder (#171)

parent 0801f280
......@@ -28,7 +28,6 @@ export const Select = ({
}) => {
const [internalValue, setInternalValue] = useState(value);
const currentValue = value !== undefined ? value : internalValue;
const option = options.find((option) => getValue(option) === currentValue);
const index = options.indexOf(option);
......@@ -68,7 +67,7 @@ export const Select = ({
const valueLabel = getLabel(option);
const visibleText = (filter === undefined || visible === AnimatedVisibility.HIDDEN) && (valueLabel || placeholder);
const visibleText = (filter === undefined || visible === AnimatedVisibility.HIDDEN) && (valueLabel || (placeholder || typeof placeholder === 'string'));
return (
<Container disabled={disabled} ref={containerRef} onClick={() => ref.current.focus() & show()} className={
[
......@@ -82,7 +81,7 @@ export const Select = ({
<Flex.Container>
<Margins inline='neg-x4'>
<Wrapper mod-hidden={!!visibleText}>
{ (typeof placeholder === 'string' || !!valueLabel) && <Flex.Item grow={1}>
{ visibleText && <Flex.Item grow={1}>
<Margins inline='x4'>
<Box is='span' textStyle='p2' textColor={ valueLabel ? 'default' : 'hint' }>{visibleText}</Box>
</Margins>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment