diff --git a/packages/dialog/package.json b/packages/dialog/package.json index f2fae9a63..b132cf84c 100644 --- a/packages/dialog/package.json +++ b/packages/dialog/package.json @@ -34,8 +34,6 @@ "@lion/overlays": "^0.6.4" }, "devDependencies": { - "@lion/button": "^0.3.43", - "@lion/icon": "^0.2.9", "@open-wc/demoing-storybook": "^0.2.0", "@open-wc/testing": "^2.3.4" } diff --git a/packages/dialog/src/LionDialog.js b/packages/dialog/src/LionDialog.js index fbe015e24..68e1b0666 100644 --- a/packages/dialog/src/LionDialog.js +++ b/packages/dialog/src/LionDialog.js @@ -15,21 +15,18 @@ export class LionDialog extends OverlayMixin(LitElement) { } _setupOpenCloseListeners() { - this.__close = () => { - this.opened = false; - }; this.__toggle = () => { this.opened = !this.opened; }; - if (this._overlayCtrl.invokerNode) { - this._overlayCtrl.invokerNode.addEventListener('click', this.__toggle); + if (this._overlayInvokerNode) { + this._overlayInvokerNode.addEventListener('click', this.__toggle); } } _teardownOpenCloseListeners() { - if (this._overlayCtrl.invokerNode) { - this._overlayCtrl.invokerNode.removeEventListener('click', this.__toggle); + if (this._overlayInvokerNode) { + this._overlayInvokerNode.removeEventListener('click', this.__toggle); } } diff --git a/packages/dialog/stories/index.stories.js b/packages/dialog/stories/index.stories.js index 29f7dbc0b..d880b5197 100644 --- a/packages/dialog/stories/index.stories.js +++ b/packages/dialog/stories/index.stories.js @@ -1,7 +1,5 @@ import { storiesOf, html, withKnobs, object } from '@open-wc/demoing-storybook'; import { css } from '@lion/core'; -import '@lion/icon/lion-icon.js'; -import '@lion/button/lion-button.js'; import '../lion-dialog.js'; const dialogDemoStyle = css` @@ -67,24 +65,25 @@ storiesOf('Overlays Specific WC | Dialog', module)
To close your dialog from some action performed inside the content slot, fire a
- close event.
+ hide event.
For the dialog to close, it will need to bubble to the content slot (use
- bubbles: true. Also composed: true if it needs to traverse shadow
- boundaries)
+ bubbles: true. If absolutely needed composed: true can be used to
+ traverse shadow boundaries)
The demo below demonstrates this