mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
fix tag input on firefox, do refactor on it
This commit is contained in:
parent
a2a60aee8e
commit
29ed51b831
4 changed files with 34 additions and 31 deletions
|
@ -7,30 +7,30 @@ import { Icon } from '~/components/input/Icon';
|
|||
import styles from './styles.module.scss';
|
||||
|
||||
interface IProps {
|
||||
className?: string;
|
||||
size?: string;
|
||||
color?: 'primary' | 'danger' | 'info' | 'black' | 'default';
|
||||
deletable?: boolean;
|
||||
hoverable?: boolean;
|
||||
editing?: boolean;
|
||||
hasInput?: boolean;
|
||||
onClick?: () => void;
|
||||
onDelete?: () => void;
|
||||
title?: string;
|
||||
}
|
||||
|
||||
const TagWrapper: FC<IProps> = ({
|
||||
className,
|
||||
color = 'default',
|
||||
children,
|
||||
size,
|
||||
deletable,
|
||||
hoverable,
|
||||
editing,
|
||||
hasInput,
|
||||
onClick,
|
||||
onDelete,
|
||||
title = '',
|
||||
}) => {
|
||||
const canBeDeleted = deletable && !editing && !hasInput;
|
||||
const canBeDeleted = deletable && !editing;
|
||||
const onDeletePress = useCallback(
|
||||
(event) => {
|
||||
if (!onDelete) {
|
||||
|
@ -53,9 +53,9 @@ const TagWrapper: FC<IProps> = ({
|
|||
[styles.hoverable]: hoverable,
|
||||
[styles.editing]: editing,
|
||||
[styles.deletable]: canBeDeleted,
|
||||
[styles.input]: hasInput,
|
||||
[styles.clickable]: onClick,
|
||||
},
|
||||
className,
|
||||
)}
|
||||
onClick={onClick}
|
||||
>
|
||||
|
|
|
@ -34,11 +34,6 @@ $big: 1.2;
|
|||
background-color: $content_bg;
|
||||
}
|
||||
|
||||
&.input {
|
||||
color: transparent !important;
|
||||
min-width: 100px;
|
||||
}
|
||||
|
||||
&.clickable {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
@ -76,26 +71,6 @@ $big: 1.2;
|
|||
height: $tag_height * $big;
|
||||
}
|
||||
}
|
||||
|
||||
input {
|
||||
background: none;
|
||||
border: none;
|
||||
color: white;
|
||||
outline: none;
|
||||
display: inline-flex;
|
||||
position: absolute;
|
||||
font: inherit;
|
||||
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
min-width: 100px;
|
||||
padding-left: $tag_height;
|
||||
padding-right: 5px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
|
||||
.hole {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue