material-tailwind icon indicating copy to clipboard operation
material-tailwind copied to clipboard

Change Dialog theme so that the dialog is scrollable if it overflows the viewport

Open marlier opened this issue 1 year ago • 1 comments

If the Dialog component is position: fixed but is taller than the viewport, this means that the bottom of the Dialog (which is below the bottom of the viewport) cannot be reached other than by expanding the window, as the Dialog remains fixed in space relative to the viewport. A simple test case for this is to create a Dialog whose DialogBody has content <div className="block h-[4000px]">test</div> or some other similar thing.

Changing the position setting to relative instead allows the Dialog to be scrolled (independent of the page body.

A workaround while this PR is being considered it to set the following theme option:

<ThemeProvider
                  value={{
                    dialog: {
                      styles: {
                        base: {
                          backdrop: {
                            position: 'relative',
                          },
                        },
                      },
                    },
                  }}
                >

marlier avatar Mar 12 '24 15:03 marlier

@marlier is attempting to deploy a commit to the ct-tailwind-team Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Mar 12 '24 15:03 vercel[bot]