feat(#1235): fix select element dropdoen background (#1237)

This commit is contained in:
Bartłomiej Głownia 2022-09-03 03:07:34 +02:00 committed by GitHub
parent f89ce686ee
commit 96d08f93cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View File

@ -2,7 +2,7 @@ import type { SelectHTMLAttributes } from 'react';
import { forwardRef } from 'react'; import { forwardRef } from 'react';
import classNames from 'classnames'; import classNames from 'classnames';
import { Icon } from '..'; import { Icon } from '..';
import { defaultFormElement } from '../../utils/shared'; import { defaultSelectElement } from '../../utils/shared';
export interface SelectProps extends SelectHTMLAttributes<HTMLSelectElement> { export interface SelectProps extends SelectHTMLAttributes<HTMLSelectElement> {
hasError?: boolean; hasError?: boolean;
@ -18,7 +18,7 @@ export const Select = forwardRef<HTMLSelectElement, SelectProps>(
ref={ref} ref={ref}
{...props} {...props}
className={classNames( className={classNames(
defaultFormElement(hasError), defaultSelectElement(hasError),
className, className,
'appearance-none rounded-md' 'appearance-none rounded-md'
)} )}

View File

@ -1,10 +1,13 @@
import classnames from 'classnames'; import classnames from 'classnames';
export const defaultSelectElement = (hasError?: boolean) =>
classnames(defaultFormElement(hasError), 'dark:bg-black');
export const defaultFormElement = (hasError?: boolean) => export const defaultFormElement = (hasError?: boolean) =>
classnames( classnames(
'flex items-center w-full text-sm', 'flex items-center w-full text-sm',
'p-2 border-2 rounded-none', 'p-2 border-2 rounded-none',
'bg-transparent ', 'bg-transparent',
'border border-neutral-500 focus:border-black dark:focus:border-white', 'border border-neutral-500 focus:border-black dark:focus:border-white',
'disabled:opacity-40', 'disabled:opacity-40',
{ {