Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Change SelectField CSS to match input height #545

Merged
merged 1 commit into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading