diff --git a/components/drawer/index.js b/components/drawer/index.js index 82a9f8c..8d93993 100644 --- a/components/drawer/index.js +++ b/components/drawer/index.js @@ -14,6 +14,14 @@ export class Drawer extends Controller { } } + async connect() { + this.element.addEventListener('click', ({ target }) => { + if (target.closest('.x-drawer-content') === null) { + this.close() + } + }) + } + async scroll({ target }) { const { scrollDrawer } = await import('winduum/src/components/drawer/index.js')