Skip to content

Commit

Permalink
Use inert instead to disable the whole thing
Browse files Browse the repository at this point in the history
  • Loading branch information
joonassandell committed Jul 20, 2024
1 parent 3774b73 commit 106f83f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/dynamic-pay-button/DynamicPayButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ export const DynamicPayButton = () => {
'has-[:focus-visible]:outline-black/30 dark:has-[:focus-visible]:outline-white/20':
!open,
'overflow-visible': overflow,
'pointer-events-none': loading,
},
)}
inert={loading ? '' : undefined}
onAnimationComplete={variant => {
variant === 'open' && inputRef.current?.focus({ preventScroll: true });
variant === 'closed' &&
Expand Down
1 change: 0 additions & 1 deletion app/dynamic-pay-button/PayButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export const PayButton = ({ className }: PayButtonProps) => {
},
className,
)}
disabled={success || loading}
onClick={handleLoading}
>
<AnimateDimension
Expand Down
1 change: 0 additions & 1 deletion app/dynamic-pay-button/TabContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ const TabContentCard = () => {
success,
},
)}
disabled={success || loading}
maxLength={3}
onChange={e => setCcv(e.target.value)}
pattern="\d*"
Expand Down
6 changes: 6 additions & 0 deletions types/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
declare module 'tailwindcss/lib/util/flattenColorPalette';
declare module 'tailwindcss/lib/util/color';

declare namespace React {
interface HTMLAttributes {
inert?: '';
}
}

0 comments on commit 106f83f

Please sign in to comment.