igniteui-angular icon indicating copy to clipboard operation
igniteui-angular copied to clipboard

[IgxOverlay] width for igx-snackbar is not set correctly when it is initially shown

Open RivaIvanova opened this issue 2 years ago • 2 comments

Description

When IgxSnackbar is initially shown, the width is not set correctly. If the snackbar is then closed and opened again, it receives the correct size.

  • igniteui-angular version: 13.1.x
  • browser: all

Steps to reproduce

  1. Open this demo.
  2. The initial appearance of the snackbar is broken.
  3. Close the snackbar and open it again by clicking on any of the above buttons.
  4. Snackbar is displayed correctly.

Result

IgxSnackbar is not shown correctly initially.

Expected result

IgxSnackbar should be shown with correct size at all times.

Attachments

This behavior could be observed in the attachment below: snackbar-overlay-demo

RivaIvanova avatar May 03 '22 13:05 RivaIvanova

There has been no recent activity and this issue has been marked inactive.

github-actions[bot] avatar Jul 03 '22 00:07 github-actions[bot]

There has been no recent activity and this issue has been marked inactive.

github-actions[bot] avatar Sep 03 '22 00:09 github-actions[bot]

There has been no recent activity and this issue has been marked inactive.

github-actions[bot] avatar Nov 05 '22 00:11 github-actions[bot]

The reason why this happens is because the snackbar is opened in the ngOnInit lifecycle hook, which is called before Angular has fully initialized the component's view. What I would suggest is to open it in the ngAfterViewInit lifecycle hook.

viktorkombov avatar Nov 30 '22 08:11 viktorkombov