Overlay Drawer - Only close on explicit button click and not on click outside

1 Answer 185 Views
Drawer
Noah
Top achievements
Rank 2
Iron
Iron
Iron
Noah asked on 21 Dec 2021, 09:11 PM
Is there a way to prevent the overlay drawer from closing when the user clicks in the gray overlay area and force them to click a button that fires the toggle method?

1 Answer, 1 is accepted

Sort by
0
Yanmario
Telerik team
answered on 24 Dec 2021, 09:13 AM

Hi Noah,

To achieve the desired requirement, the developer should handle the click event on the k-overlay that is rendered by the component. Please check the following example demonstrating such an approach:

https://stackblitz.com/edit/angular-3pspvz?file=app/app.component.ts

Additional business logic can be applied and conditionally prevent or execute the event that will close the Drawer component.

I hope this helps. Please let me know if I can provide any further assistance on this matter.

Regards,
Yanmario
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

All Star
Top achievements
Rank 1
commented on 27 Dec 2021, 05:54 AM

good
Tags
Drawer
Asked by
Noah
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Yanmario
Telerik team
Share this question
or