Skip to content

Commit

Permalink
fix(ui): correct select widget title position
Browse files Browse the repository at this point in the history
  • Loading branch information
mrfelton committed Aug 8, 2019
1 parent 702e00d commit 8b285a9
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions renderer/components/UI/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import AngleUp from 'components/Icon/AngleUp'
import AngleDown from 'components/Icon/AngleDown'
import Text from './Text'
import { BasicInput } from './Input'
import InputLabel from './InputLabel'
import messages from './messages'

const SelectOptionList = styled.ul`
Expand Down Expand Up @@ -116,7 +117,11 @@ const Select = props => {
fieldApi,
fieldState,
iconSize,
isRequired,
theme,
label,
field,
tooltip,
color,
onValueSelected,
initialSelectedItem: initialSelectedItemOriginal,
Expand Down Expand Up @@ -177,8 +182,15 @@ const Select = props => {

return (
<div style={{ position: 'relative' }}>
{label && (
<InputLabel field={field} isRequired={isRequired} tooltip={tooltip}>
{label}
</InputLabel>
)}
<Flex alignItems="center">
<StyledInput
field={field}
isRequired={isRequired}
placeholder={intl.formatMessage({ ...messages.select_placeholder })}
{...rest}
initialValue={getInitialValue()}
Expand Down Expand Up @@ -209,15 +221,19 @@ const Select = props => {

Select.propTypes = {
color: PropTypes.string,
field: PropTypes.string.isRequired,
fieldApi: PropTypes.object.isRequired,
fieldState: PropTypes.object.isRequired,
iconSize: PropTypes.number,
initialSelectedItem: PropTypes.string,
intl: intlShape.isRequired,
isRequired: PropTypes.bool,
items: PropTypes.array,
label: PropTypes.string,
messageMapper: PropTypes.func,
onValueSelected: PropTypes.func,
theme: PropTypes.object.isRequired,
tooltip: PropTypes.string,
}

Select.defaultProps = {
Expand Down

0 comments on commit 8b285a9

Please sign in to comment.