How to stop leaving page after confirm box

I want to call confirm box inside onPageWillLeave function. When user will confirm that want to leave then leave page else stop leaving. How can I do ?

@Ashurbeyli Excuse me, do you solve this problem?

I guess not, I dont remember exactly :confused:

I just wanted to mention that there’s an open issue about this, in case that someone finds this topic: