Close ActionSheetController on Device back button click

Version details:
ionic version - “6.10.1”,
ionic-angular: “3.9.9”

Issue description:
On click photo or upload photo button to open a popup(I’m using ActionSheetController for popup) for capture image from gallery or using a camera,
then after click on the device’s back button to back on the last or previous page and it goes on the last or previous page but the popup is still open, it cants close.

I want to close the popup and then back the last or the previous page.

Any one face this issue