diff --git a/src/lib/dialog/dialog-adapter.ts b/src/lib/dialog/dialog-adapter.ts index 08d39fcfc..652348770 100644 --- a/src/lib/dialog/dialog-adapter.ts +++ b/src/lib/dialog/dialog-adapter.ts @@ -1,6 +1,10 @@ import { deepQuerySelectorAll, getActiveElement, getShadowElement, removeElement, toggleClass } from '@tylertech/forge-core'; import { BACKDROP_CONSTANTS, IBackdropComponent } from '../backdrop'; +import { CHECKBOX_CONSTANTS } from '../checkbox/checkbox-constants'; import { BaseAdapter, IBaseAdapter } from '../core/base/base-adapter'; +import { ICON_BUTTON_CONSTANTS } from '../icon-button/icon-button-constants'; +import { RADIO_CONSTANTS } from '../radio/radio-constants'; +import { SWITCH_CONSTANTS } from '../switch/switch-constants'; import { IDialogComponent } from './dialog'; import { DialogPositionType, DIALOG_CONSTANTS } from './dialog-constants'; @@ -24,6 +28,7 @@ export interface IDialogAdapter extends IBaseAdapter { addRootClass(name: string): void; setFullscreen(value: boolean): void; setMoveable(value: boolean): void; + tryLayoutRippleChildren(): void; setMoveTarget(selector: string): boolean; setMoveTargetHandler(type: string, listener: (evt: MouseEvent) => void): void; removeDragTargetHandler(type: string, listener: (evt: MouseEvent) => void): void; @@ -152,6 +157,17 @@ export class DialogAdapter extends BaseAdapter implements IDia toggleClass(this._containerElement, value, DIALOG_CONSTANTS.classes.MOVEABLE); } + public tryLayoutRippleChildren(): void { + const selectors = [ + ICON_BUTTON_CONSTANTS.elementName, + SWITCH_CONSTANTS.elementName, + CHECKBOX_CONSTANTS.elementName, + RADIO_CONSTANTS.elementName + ]; + const rippleChildren = deepQuerySelectorAll(this._component, selectors.join(':focus-within,')) as Array; + rippleChildren.filter(el => typeof el.layout === 'function').forEach(el => el.layout()); + } + public setMoveTarget(selector: string): boolean { if (!selector) { return false; diff --git a/src/lib/dialog/dialog-foundation.ts b/src/lib/dialog/dialog-foundation.ts index 20ffa8e58..7ad412d62 100644 --- a/src/lib/dialog/dialog-foundation.ts +++ b/src/lib/dialog/dialog-foundation.ts @@ -212,6 +212,7 @@ export class DialogFoundation implements IDialogFoundation { this._adapter.deregisterTransitionEndHandler(this._transitionEndHandler); this._adapter.setAnimating(false); this._adapter.emitHostEvent(DIALOG_CONSTANTS.events.READY); + this._adapter.tryLayoutRippleChildren(); if (this._moveable) { this._initMoveTarget();