Commit 26ab2b5 1 parent 0801f28 commit 26ab2b5 Copy full SHA for 26ab2b5
File tree 1 file changed +2
-3
lines changed
packages/fuselage/src/components/Select
1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,6 @@ export const Select = ({
28
28
} ) => {
29
29
const [ internalValue , setInternalValue ] = useState ( value ) ;
30
30
31
-
32
31
const currentValue = value !== undefined ? value : internalValue ;
33
32
const option = options . find ( ( option ) => getValue ( option ) === currentValue ) ;
34
33
const index = options . indexOf ( option ) ;
@@ -68,7 +67,7 @@ export const Select = ({
68
67
69
68
const valueLabel = getLabel ( option ) ;
70
69
71
- const visibleText = ( filter === undefined || visible === AnimatedVisibility . HIDDEN ) && ( valueLabel || placeholder ) ;
70
+ const visibleText = ( filter === undefined || visible === AnimatedVisibility . HIDDEN ) && ( valueLabel || ( placeholder || typeof placeholder === 'string' ) ) ;
72
71
return (
73
72
< Container disabled = { disabled } ref = { containerRef } onClick = { ( ) => ref . current . focus ( ) & show ( ) } className = {
74
73
[
@@ -82,7 +81,7 @@ export const Select = ({
82
81
< Flex . Container >
83
82
< Margins inline = 'neg-x4' >
84
83
< Wrapper mod-hidden = { ! ! visibleText } >
85
- { ( typeof placeholder === 'string' || ! ! valueLabel ) && < Flex . Item grow = { 1 } >
84
+ { visibleText && < Flex . Item grow = { 1 } >
86
85
< Margins inline = 'x4' >
87
86
< Box is = 'span' textStyle = 'p2' textColor = { valueLabel ? 'default' : 'hint' } > { visibleText } </ Box >
88
87
</ Margins >
You can’t perform that action at this time.
0 commit comments