mirror of
https://github.com/jeffvli/feishin.git
synced 2026-06-20 02:14:23 +02:00
implement double click handler on default controls
This commit is contained in:
@@ -176,6 +176,7 @@ export const ItemCardControls = ({
|
||||
icon="ellipsisHorizontal"
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
controls?.onMore?.({
|
||||
event: e,
|
||||
internalState,
|
||||
@@ -183,6 +184,10 @@ export const ItemCardControls = ({
|
||||
itemType,
|
||||
});
|
||||
}}
|
||||
onDoubleClick={(e) => {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{controls?.onExpand && (
|
||||
@@ -260,14 +265,25 @@ interface SecondaryButtonProps {
|
||||
onClick?: (e: MouseEvent<HTMLButtonElement>) => void;
|
||||
}
|
||||
|
||||
const SecondaryButton = ({ className, icon, onClick }: SecondaryButtonProps) => {
|
||||
const SecondaryButton = ({
|
||||
className,
|
||||
icon,
|
||||
onClick,
|
||||
onDoubleClick,
|
||||
}: SecondaryButtonProps & { onDoubleClick?: (e: MouseEvent<HTMLButtonElement>) => void }) => {
|
||||
return (
|
||||
<button
|
||||
className={clsx(styles.secondaryButton, className)}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
onClick?.(e);
|
||||
}}
|
||||
onDoubleClick={(e) => {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
onDoubleClick?.(e);
|
||||
}}
|
||||
>
|
||||
<Icon icon={icon} size="lg" />
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user