How to use overlay in a dialog inside a window in Kendo UI?

Asked

Viewed 29 times

0

I currently use the Kendo Ui Angular

I am currently trying to use inside a window a component that calls a dialog, but my dialog is not applying the overlay opacity effect, currently having this result:

inserir a descrição da imagem aqui

Looking at the gift tree through the inspect I can achieve my expected effect by changing the class property .k-window .k-overlay for opacity: 0.5:

.k-window .k-overlay {
    position: absolute;
    opacity: 0.5;
}

Having then this result:

inserir a descrição da imagem aqui

I tried to add an id in my class:

<kendo-dialog id="dialogConf" title="Confirmação" *ngIf="opened" (close)="closeDialog(false)" [minWidth]="250" [width]="450">
    <p style="margin: 30px; text-align: center;">Confirma o cancelamento?</p>
    <kendo-dialog-actions>
        <button kendoButton (click)="closeDialog(false)">Não</button>
        <button kendoButton (click)="closeDialog(true)" primary="true">Sim</button>
    </kendo-dialog-actions>
</kendo-dialog>

And then apply on .scss of my component:

#dialogConf.k-window .k-overlay {
    opacity: 0.5!important;
}

I also tried to:

.k-window .k-overlay::shadow {
    opacity: 0.5!important;
}

@Edit:

I managed to solve through the code:

::ng-deep .k-window .k-overlay {
    opacity: 0.5!important;
}

But I read that soon this pseudo selector will be removed soon because it goes over the style isolation protection and this can potentially encourage bad usage practices, so I leave the question open if there is a better solution.

  • 1

    if you want to solve with gambiarra take this modal that you put the ID and put a box-shadow on it so box-shadow: 0 0 0 0 4000px rgba(0, 0, 0, 0.5); If you think it serves you as an answer tell me that I set an example for you. Another option is you change the z-index of the larger modal that is below it to stay below the overlay when you open one modal inside the other

  • @hugocsl You can add an answer so that future users have more than one option ~gambiarra~ to solve this problem, if they remove the pseudo selector :shadow would still have other options for those who need it in the future, so I think valid yes

  • 1

    Veronse was worth the force, but I believe that just the comment is enough since it is something very simple... besides, because you have already solved it the right way, I believe you will not accept the "gambiarra" as an rss response

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.