NG-ZORRO/ng-zorro-antd

Remove nz-drawer focus

vatsake opened this issue ยท 2 comments

Reproduction link

https://stackblitz.com/edit/ng-zorro-antd-ivy-eqsoqx?file=src%2Fapp%2Fapp.component.ts

Steps to reproduce

  1. Click the first button
  2. Close the drawer
  3. Click the second button
  4. Close the drawer

The first button will be focused

What is expected?

The previous button is focused or nothing is focused at all.

What is actually happening?

nz-drawer components saves the first focused element.
So it will focus that one after drawer close.

Environment Info
ng-zorro-antd 18.1.1
Browser Chrome

It might not look like a big issue, but in my form, the buttons are far apart.
After closing the drawer, the element will be focused and the window will be scrolled to that element.

Maybe add option to focus or not?

Hi @vatsake ,
Thank you for reporting this issue,
a fix is on it's way ๐Ÿ‘

@vatsake
My bad, i had forgotten to make the pr for this change back then ๐Ÿ˜…๐Ÿ˜…
This should fix this issue #8893