primitives icon indicating copy to clipboard operation
primitives copied to clipboard

Limit height of Dialog.Overlay

Open pavelgromyko opened this issue 1 year ago • 4 comments

I have an application that is written in electron using react.

As you understand from the question, I use Dialog. When a Dialog.Contentis opened, Dialog.Overlay extends to the entire screen; therefore, outside of Dialog.Content, the entire application is not active. However, my application has a TitleBar (which takes up 50px from the top of the screen) and I would like the Dialog.Overlay not to extend to the TitleBar . That is, when opening Dialog.Content, Dialog.Overlay would cover the entire window except the TitleBar

my Dialog.Overlay now

<Dialog.Overlay className="data-[state=open]:animate-overlayShow fixed inset-0 bg-[grey] backdrop-blur-[2px]" />

pavelgromyko avatar May 03 '24 11:05 pavelgromyko

you can change the value of inset-0 to whatever you want: ... inset-0 top-[50px] ...

joaom00 avatar May 18 '24 23:05 joaom00

@joaom00 Thanks, that's a good idea. I tried it too. But the problem here is that this space (50 pixels) remains disabled. That is, I cannot press buttons in TitleBar

pavelgromyko avatar May 20 '24 13:05 pavelgromyko

@joaom00 Perhaps you know how to make the buttons located in the TitleBar active?

pavelgromyko avatar May 20 '24 13:05 pavelgromyko

Try set pointer-events: auto in the TitleBar

joaom00 avatar May 20 '24 14:05 joaom00

@joaom00 It`s great! Thank you a lot!

pavelgromyko avatar May 21 '24 06:05 pavelgromyko