New to KendoReact? Start a free 30-day trial
Change the expanded state of the Drawer when clicking outside of it
Environment
Product Version | 5.13.0 |
Product | Progress® KendoReact Drawer |
Description
I want to hide the Drawer when I click outside of it
Solution
To handle the click event, add event listener to the document for the "mousedown" event. Within the event handler check if the clicked target is within the Drawer wrapping container element and if not, change the "expanded" state variable.
The following example demonstrates this approach:
Change Theme
Theme
Loading ...