fix(locker): use onPointerDown for slot picker item selection
- Change onClick to onPointerDown with preventDefault on item buttons - Also update Cancel and Clear Slot buttons for consistency - Fixes item selection not working inside the dialog
This commit is contained in:
parent
11e9bfef24
commit
bf6b29690f
1 changed files with 16 additions and 3 deletions
|
|
@ -76,7 +76,10 @@ export function WardrobeSlotPicker({
|
||||||
key={entry.assetId}
|
key={entry.assetId}
|
||||||
type="button"
|
type="button"
|
||||||
disabled={busy}
|
disabled={busy}
|
||||||
onClick={() => onPick(entry.assetId)}
|
onPointerDown={(e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
onPick(entry.assetId);
|
||||||
|
}}
|
||||||
className={cn(
|
className={cn(
|
||||||
"flex items-center gap-3 rounded-md border px-3 py-2 text-left text-sm transition-colors",
|
"flex items-center gap-3 rounded-md border px-3 py-2 text-left text-sm transition-colors",
|
||||||
selected
|
selected
|
||||||
|
|
@ -101,12 +104,22 @@ export function WardrobeSlotPicker({
|
||||||
<Button
|
<Button
|
||||||
variant="outline"
|
variant="outline"
|
||||||
disabled={busy}
|
disabled={busy}
|
||||||
onClick={() => onOpenChange(false)}
|
onPointerDown={(e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
onOpenChange(false);
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</Button>
|
</Button>
|
||||||
{currentId != null && (
|
{currentId != null && (
|
||||||
<Button variant="ghost" disabled={busy} onClick={() => onPick(null)}>
|
<Button
|
||||||
|
variant="ghost"
|
||||||
|
disabled={busy}
|
||||||
|
onPointerDown={(e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
onPick(null);
|
||||||
|
}}
|
||||||
|
>
|
||||||
Clear Slot
|
Clear Slot
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue