Skip to content

Commit

Permalink
Revert "Focus confirm button instead of cancel in modals (#2340)"
Browse files Browse the repository at this point in the history
  • Loading branch information
david-crespo committed Jul 26, 2024
1 parent 84a1501 commit d32fddc
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions app/ui/lib/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,10 @@ Modal.Footer = ({
}) => (
<footer className="flex items-center justify-between border-t px-3 py-3 border-secondary">
<div className="mr-4">{children}</div>
<div className="flex flex-row-reverse gap-2">
{/* Note the confirm button is first so it autofocuses when the modal opens,
but it displays in the right order because of flex-row-reverse */}
<div className="space-x-2">
<Button variant="secondary" size="sm" onClick={onDismiss}>
{cancelText || 'Cancel'}
</Button>
<Button
size="sm"
variant={actionType}
Expand All @@ -144,9 +145,6 @@ Modal.Footer = ({
>
{actionText}
</Button>
<Button variant="secondary" size="sm" onClick={onDismiss}>
{cancelText || 'Cancel'}
</Button>
</div>
</footer>
)

0 comments on commit d32fddc

Please sign in to comment.