Skip to content

Commit cd795a9

Browse files
committed
fix: match skeleton loader elements to form height
Line height must be set to 1 on the parent container in order for an element's height to match its exact width. See: dvtng/react-loading-skeleton#23 (comment)
1 parent 0a6ff2f commit cd795a9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

web/src/modules/song/components/client/FormElements.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const Area = ({
2020
{isLoading ? (
2121
<Skeleton height='20rem' />
2222
) : (
23-
<div className='flex justify-center w-full rounded-lg border-2 border-zinc-500 p-8 mb-4'>
23+
<div className='flex justify-center w-full rounded-lg outline-none border-2 border-zinc-500 p-8 mb-4'>
2424
{children}
2525
</div>
2626
)}
@@ -43,7 +43,7 @@ export const Input = forwardRef<
4343
<>
4444
{label && <label htmlFor={id}>{label}</label>}
4545
{isLoading ? (
46-
<Skeleton height={'3rem'} />
46+
<Skeleton height='3rem' containerClassName='block leading-none' />
4747
) : (
4848
<input
4949
type='text'
@@ -75,7 +75,7 @@ export const TextArea = forwardRef<
7575
<>
7676
{label && <label htmlFor={id}>{label}</label>}
7777
{isLoading ? (
78-
<Skeleton height={'15rem'} />
78+
<Skeleton height='12rem' containerClassName='block leading-none' />
7979
) : (
8080
<textarea
8181
id={id}
@@ -107,7 +107,7 @@ export const Select = forwardRef<
107107
<>
108108
{label && <label htmlFor={id}>{label}</label>}
109109
{isLoading ? (
110-
<Skeleton height={'3rem'} />
110+
<Skeleton height='3rem' containerClassName='block leading-none' />
111111
) : (
112112
<select
113113
ref={ref}

0 commit comments

Comments
 (0)