Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/website/content/docs/chat/api/api-docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -3414,12 +3414,12 @@
{
"name": "ChatSidenavScrimComponent",
"kind": "class",
"description": "Backdrop scrim for chat-sidenav's drawer mode, rendered as a sibling of\n<chat-sidenav> so its z-index sits cleanly between the page content\nand the drawer host (escapes the drawer host's stacking context).\n\nUsage:\n <chat-sidenav-scrim [open]=\"drawerOpen()\" (close)=\"drawerOpen.set(false)\" />\n <chat-sidenav [(open)]=\"drawerOpen\" ...></chat-sidenav>",
"description": "Backdrop scrim for chat-sidenav's drawer mode, rendered as a sibling of\n<chat-sidenav> so its z-index sits cleanly between the page content\nand the drawer host (escapes the drawer host's stacking context).\n\nUsage:\n <chat-sidenav-scrim [open]=\"drawerOpen()\" (dismiss)=\"drawerOpen.set(false)\" />\n <chat-sidenav [(open)]=\"drawerOpen\" ...></chat-sidenav>",
"params": [],
"examples": [],
"properties": [
{
"name": "close",
"name": "dismiss",
"type": "OutputEmitterRef<void>",
"description": "Fires when the user clicks the backdrop.",
"optional": false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

<chat-sidenav-scrim
[open]="sidenavMode() === 'drawer' && drawerOpen()"
(close)="drawerOpen.set(false)"
(dismiss)="drawerOpen.set(false)"
/>
<chat-sidenav
[threads]="visibleThreads()"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ describe('ChatSidenavScrimComponent', () => {
expect(btn.getAttribute('aria-label')).toBe('Close conversations');
});

it('emits (close) on click', () => {
it('emits (dismiss) on click', () => {
fx.componentRef.setInput('open', true);
fx.detectChanges();
let closed = false;
fx.componentInstance.close.subscribe(() => { closed = true; });
let dismissed = false;
fx.componentInstance.dismiss.subscribe(() => { dismissed = true; });
const btn = fx.nativeElement.querySelector('button.chat-sidenav-scrim__button') as HTMLButtonElement;
btn.click();
expect(closed).toBe(true);
expect(dismissed).toBe(true);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { ChangeDetectionStrategy, Component, input, output } from '@angular/core
* and the drawer host (escapes the drawer host's stacking context).
*
* Usage:
* <chat-sidenav-scrim [open]="drawerOpen()" (close)="drawerOpen.set(false)" />
* <chat-sidenav-scrim [open]="drawerOpen()" (dismiss)="drawerOpen.set(false)" />
* <chat-sidenav [(open)]="drawerOpen" ...></chat-sidenav>
*/
@Component({
Expand All @@ -21,7 +21,7 @@ import { ChangeDetectionStrategy, Component, input, output } from '@angular/core
type="button"
class="chat-sidenav-scrim__button"
aria-label="Close conversations"
(click)="close.emit()"
(click)="dismiss.emit()"
></button>
}
`,
Expand All @@ -44,5 +44,5 @@ export class ChatSidenavScrimComponent {
/** When true, render the backdrop button covering the viewport. */
readonly open = input<boolean>(false);
/** Fires when the user clicks the backdrop. */
readonly close = output<void>();
readonly dismiss = output<void>();
}