@Saranika123
Welcome to the HP support community.
The Paper tray extender does not automatically close, you will have to manually close it.
You can refer page number 26 in this user guide:- click here
I hope that helps.
To thank me for my efforts to help you, please mark my post as an accepted solution so that it benefits several others.
Cheers.
Sandytechy20
I am an HP Employee