Commit 650bd5cf authored by Chunchi Che's avatar Chunchi Che

enable double click in SelectCardsModal

parent cebad4ad
Pipeline #28724 passed with stages
in 10 minutes and 29 seconds
......@@ -104,6 +104,15 @@ export const SelectCardsModal: React.FC<SelectCardsModalProps> = ({
fetchStrings(Region.System, n),
);
// Quick select if possiable
const onQuickSelect = (option: Option) => {
if (max === 1 || single) {
// if `max` is 1, it means that we can just select one,
// so quick selection is possiable in this case.
onSubmit([option]);
}
};
return (
<NeosModal
title={
......@@ -180,7 +189,9 @@ export const SelectCardsModal: React.FC<SelectCardsModalProps> = ({
key={j}
>
{/* 这儿必须有一个div,不然tooltip不生效 */}
<div>
<div
onDoubleClick={() => onQuickSelect(card as Option)}
>
<CheckCard
cover={
<YgoCard
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment