Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
RocketChat
Rocket.Chat.Fuselage
Commits
26ab2b57
Unverified
Commit
26ab2b57
authored
Mar 19, 2020
by
gabriellsh
Committed by
GitHub
Mar 19, 2020
Browse files
fix: Empty space before SelectFiltered placeholder (#171)
parent
0801f280
Changes
1
Hide whitespace changes
Inline
Side-by-side
packages/fuselage/src/components/Select/Select.js
View file @
26ab2b57
...
...
@@ -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
>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment