URL header appears in my TWA when Javascript Alert or Confirm box appears

Issue: Whenever a JavaScript confirm or alert box is being used in the code, the URL header appears and does not goes until the app is again opened after opening any other app on the mobile.(i.e. Sent to background and again brought to foreground)

Simply refreshing by pulling down does not helps.

My TWA app, downloaded from google play store, was working fine for several months up until few days back, without any issue of URL header appearing.

My .well-known/assetlinks.json is configured in my host.

It only appears while using JavaScript Alert and Confirm box.

How to resolve this?