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}
|
||||
type="button"
|
||||
disabled={busy}
|
||||
onClick={() => onPick(entry.assetId)}
|
||||
onPointerDown={(e) => {
|
||||
e.preventDefault();
|
||||
onPick(entry.assetId);
|
||||
}}
|
||||
className={cn(
|
||||
"flex items-center gap-3 rounded-md border px-3 py-2 text-left text-sm transition-colors",
|
||||
selected
|
||||
|
|
@ -101,12 +104,22 @@ export function WardrobeSlotPicker({
|
|||
<Button
|
||||
variant="outline"
|
||||
disabled={busy}
|
||||
onClick={() => onOpenChange(false)}
|
||||
onPointerDown={(e) => {
|
||||
e.preventDefault();
|
||||
onOpenChange(false);
|
||||
}}
|
||||
>
|
||||
Cancel
|
||||
</Button>
|
||||
{currentId != null && (
|
||||
<Button variant="ghost" disabled={busy} onClick={() => onPick(null)}>
|
||||
<Button
|
||||
variant="ghost"
|
||||
disabled={busy}
|
||||
onPointerDown={(e) => {
|
||||
e.preventDefault();
|
||||
onPick(null);
|
||||
}}
|
||||
>
|
||||
Clear Slot
|
||||
</Button>
|
||||
)}
|
||||
|
|
|
|||
Loading…
Reference in a new issue