Skip to content

Commit

Permalink
fix: Change SelectField CSS to match input height (#545)
Browse files Browse the repository at this point in the history
  • Loading branch information
LautaroPetaccio committed Jul 10, 2024
1 parent a3c8c45 commit 0f2aa5e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
6 changes: 3 additions & 3 deletions src/components/SelectField/SelectField.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
border-radius: 0px;
border: none;
border-bottom: 2px solid var(--divider);
padding: 2px 0px 12px 0px;
padding: 2px 0px 0px 0px;
width: 100%;
margin-top: 8px;
min-height: 40px;
Expand Down Expand Up @@ -37,7 +37,7 @@
font-size: 20px;
font-weight: 500;
font-family: var(--font-family);
line-height: 18px;
line-height: 30px;
}

.dcl.select-field .ui.dropdown > .default.text {
Expand All @@ -57,7 +57,7 @@

.dcl.select-field .ui.dropdown .dropdown.icon {
padding-right: 0px;
padding-top: 4px;
padding-bottom: 0px;
color: var(--text);
}

Expand Down
31 changes: 19 additions & 12 deletions src/components/SelectField/SelectField.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as React from 'react'
import classNames from 'classnames'
import { Dropdown, DropdownProps } from '../Dropdown/Dropdown'
import { Header } from '../Header/Header'
import './SelectField.css'
Expand All @@ -13,20 +14,26 @@ export type SelectFieldProps = DropdownProps & {

export class SelectField extends React.PureComponent<SelectFieldProps> {
render(): JSX.Element {
const { label, header, options, message, error, border, ...rest } =
this.props
let classes = 'dcl select-field'

if (error) {
classes += ' error warning circle'
}

if (border) {
classes += ' border'
}
const {
label,
header,
options,
message,
error,
border,
className,
...rest
} = this.props

return (
<div className={classes}>
<div
className={classNames(
'dcl',
'select-field',
{ error: error, warning: error, circle: error, border: border },
className
)}
>
{label ? <Header sub>{label}</Header> : null}

<Dropdown search selection options={options} {...rest}>
Expand Down

0 comments on commit 0f2aa5e

Please sign in to comment.