ui icon indicating copy to clipboard operation
ui copied to clipboard

How do I change Dialog Modal width?

Open SachinShekhar opened this issue 10 months ago • 3 comments

I want the Dialog modal to span the entire width of the screen. Applying h-full on DialogContent works, but w-full, w-[600px] etc have no effect on the modal width. Child flex-wrap wraps at just one element. Child grid-cols-5 forcefully shrinks items to fit five, but modal width remains the same.

SachinShekhar avatar Oct 31 '23 06:10 SachinShekhar

Did you try min-width instead of width?

servesh-chaturvedi avatar Oct 31 '23 09:10 servesh-chaturvedi

min-w-full worked. Why?

SachinShekhar avatar Oct 31 '23 09:10 SachinShekhar

The Dialog component has its width calculated based on w-full and max-w-lg. I assume you are having issues changing the width on desktop, so you probably just need to change the max-w property instead of w

Pedromigacz avatar Dec 07 '23 04:12 Pedromigacz

This issue has been automatically closed because it received no activity for a while. If you think it was closed by accident, please leave a comment. Thank you.

shadcn avatar Feb 13 '24 23:02 shadcn

For those who in trouble with dialog's width setting, The DialogContent component use max-w-lg which translate into max-width: 32rem; (512px) See change

To deal with this, you can remove max-w-lg in components/ui/dialog.tsx or use sm:max-w-[Npx] in the DialogContent component.

drwpls avatar Feb 28 '24 09:02 drwpls

How do you prevent <DropdownMenu> from closing on clicking DropdownMenuItem

 <DropdownMenuItem
      onClick={() => onMenuClick('light')}
      className="px-6 text-md ">
      <Sun className='text-gray-600 hover:text-gray-900 ' size={24} />
 </DropdownMenuItem>

maheshj01 avatar Apr 10 '24 02:04 maheshj01

@maheshmnj I guess you probably want the Popover Component not the dropdown if you want something similar to the status and priority filters in tasks example.

servesh-chaturvedi avatar Apr 10 '24 05:04 servesh-chaturvedi

min-w-full worked. Why?

this is working fine for me as well

mohd-khan09 avatar Apr 24 '24 06:04 mohd-khan09

Simply add classes inside the DialogContent like this w-80 sm:w-full sm:max-w-lg

anwarhossain1 avatar May 26 '24 10:05 anwarhossain1