diff --git a/packages/components/src/components/drawer/drawer.e2e.ts b/packages/components/src/components/drawer/drawer.e2e.ts index 2174932772..44d7bb63f7 100644 --- a/packages/components/src/components/drawer/drawer.e2e.ts +++ b/packages/components/src/components/drawer/drawer.e2e.ts @@ -5,7 +5,7 @@ import { KolEvent } from '../../utils/events'; test.describe('kol-drawer', () => { test.describe('Callbacks', () => { test(`should call 'onClose' callback when drawer is closed`, async ({ page }) => { - await page.setContent('Drawer content'); + await page.setContent('Drawer content'); const kolDrawer = page.locator('kol-drawer'); const callbackPromise = kolDrawer.evaluate((element: HTMLKolDrawerElement) => { @@ -27,7 +27,7 @@ test.describe('kol-drawer', () => { test.describe('DOM events', () => { test(`should emit 'close' when drawer is closed`, async ({ page }) => { - await page.setContent('Drawer content'); + await page.setContent('Drawer content'); const kolDrawer = page.locator('kol-drawer'); const eventPromise = kolDrawer.evaluate((element: HTMLKolDrawerElement, KolEvent) => { diff --git a/packages/components/src/components/drawer/shadow.tsx b/packages/components/src/components/drawer/shadow.tsx index d2071cd7ef..7a3f5adbb6 100644 --- a/packages/components/src/components/drawer/shadow.tsx +++ b/packages/components/src/components/drawer/shadow.tsx @@ -1,6 +1,6 @@ /* eslint-disable jsx-a11y/no-noninteractive-element-interactions */ -import type { AlignPropType, DrawerAPI, DrawerStates, KoliBriModalEventCallbacks, LabelPropType, ModalPropType, OpenPropType } from '../../schema'; -import { setState, validateAlign, validateLabel, validateModal, validateOpen } from '../../schema'; +import type { AlignPropType, DrawerAPI, DrawerStates, KoliBriModalEventCallbacks, LabelPropType, OpenPropType } from '../../schema'; +import { setState, validateAlign, validateLabel, validateOpen } from '../../schema'; import type { JSX } from '@stencil/core'; import { Component, Element, h, Host, Method, Prop, State, Watch } from '@stencil/core'; import { dispatchDomEvent, KolEvent } from '../../utils/events'; @@ -28,11 +28,7 @@ export class KolDrawer implements DrawerAPI { ...this.state, _open: true, }; - if (this.state._modal) { - this.dialogElement?.showModal(); - } else { - this.dialogElement?.show(); - } + this.dialogElement?.showModal(); } @Method() @@ -71,13 +67,8 @@ export class KolDrawer implements DrawerAPI { private getRef = (el: HTMLDialogElement | undefined) => (this.dialogElement = el as HTMLDialogElement); public render(): JSX.Element { - const isModal = this.state._modal; return ( - + {this.renderDialogContent()} @@ -100,11 +91,6 @@ export class KolDrawer implements DrawerAPI { */ @Prop() public _label!: LabelPropType; - /** - * Indicates whether the drawer is a modal. - */ - @Prop() public _modal?: ModalPropType; - /** * Specifies the EventCallback function to be called when the drawer is closing. */ @@ -128,11 +114,6 @@ export class KolDrawer implements DrawerAPI { validateAlign(this, value); } - @Watch('_modal') - public validateModal(value?: ModalPropType): void { - validateModal(this, value); - } - @Watch('_open') public async validateOpen(value?: OpenPropType): Promise { if (typeof value === 'boolean') { @@ -188,7 +169,6 @@ export class KolDrawer implements DrawerAPI { this.validateLabel(this._label); await this.validateOpen(this._open); this.validateAlign(this._align); - this.validateModal(this._modal); this.validateOn(this._on); } } diff --git a/packages/components/src/components/drawer/test/__snapshots__/snapshot.spec.tsx.snap b/packages/components/src/components/drawer/test/__snapshots__/snapshot.spec.tsx.snap index 18d5cf0bd2..f1bc8efbbe 100644 --- a/packages/components/src/components/drawer/test/__snapshots__/snapshot.spec.tsx.snap +++ b/packages/components/src/components/drawer/test/__snapshots__/snapshot.spec.tsx.snap @@ -1,77 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`kol-drawer should render with _label="Label" _modal=false _open=false 1`] = ` - - - -`; - -exports[`kol-drawer should render with _label="Label" _modal=false _open=true _variant="bottom" 1`] = ` - - - -`; - -exports[`kol-drawer should render with _label="Label" _modal=false _open=true _variant="left" 1`] = ` - - - -`; - -exports[`kol-drawer should render with _label="Label" _modal=false _open=true _variant="right" 1`] = ` - - - -`; - -exports[`kol-drawer should render with _label="Label" _modal=false _open=true _variant="top" 1`] = ` - - - -`; - -exports[`kol-drawer should render with _label="Label" _modal=true _open=false 1`] = ` - +exports[`kol-drawer should render with _label="Label" _open=false 1`] = ` +