disable right click in login page extjs not working - extjs

I want to disable right click on a login page in extjs to prevent pasting of credentials. No matter whatever i tried, it is not working. Any suggestions please

You have to listen to contextmenu on the body
Ext.getBody().on('contextmenu', function(e) {e.preventDefault();});
Remember to clear the listener, once you need it no longer.

Related

How to prevent reload and show custom popup?

I have a form, when my user tries to reload, I need to show the popup "If you reload the page you cannot use this form".
the page is reloaded using a button in browsers
How to prevent reload and show custom popup ?
The browsers are designed to ask for confirmation with the native popup https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event
And this cannot be customized (which would require async handling)
If the latter was possible people would get stuck on porn pages and would never have the chance to leave them.

How to handle a back button click in a SPA?

I'm developing a SPA with NextJS, and it's made out of exclusively one page. There's not next/link or Router usage whatsoever. The user would visit the page and everything would happen within the DOM, including all button click, view navigations, etc.
The problem that I'm facing right now, is that if the user at any point clicks the back button.. well, they'll leave the site.
I'd love to hear any suggestions that anyone has regarding this.
The beforeunload can help you.
Example:
window.onbeforeunload = function(){
return ''
}

Call a function on onClick of OK button in Prompt of React Router

I am using React Router's Prompt to show a prompt if the user is navigating from the page without saving their changes. I want to give the user an option to save or discard the changes they have made in the form.
I can show the prompt but cannot handle the user's click. I cannot save anything if the user clicks on the ok button. I checked the doc and didn't find any way of doing it.
Please help me to solve this issue. Thanks in advance.

Globally disable click out side of ionicModal

ionicModal is appearing like a popup along with backdrop in iPad (Fine in android tabs with full screen view). Modal is closing whenever user clicks on backdrop. It will be an issue if user is filling a form.
Yes, I can use backdropClickToClose: false property while creating modal but I used over 60 modals all over my app. Is there any way to set backdropClickToClose:false globally in a config like
$ionicModal.config {
backdropClickToClose : false
}
Thanks in advance.
Unfortunately, I have not been able to find how to do this using config. There currently doesn't seem to be a way to do it that way.
The only thing I found is the commit for the backdropClickToClose configuration for $ionicModal, which may give others a clue as to how this can be achieved.
Another idea would be to wrap the $ionicModal in a service and have some default parameters implemented in there, but I am not sure whether that would be a solution to your problem.
If you really want to be able to configure this, you may want to consider submitting an issue on GitHub, which you can do here.

Remove back button Sencha Touch 2

I am using Sencha Touch 2 to build an application. I am initially loading the navigation view in the view port and then pushing the login view. After login it takes to the main page. Here I have a back button, which when clicked goes back to the login page. How can I prevent this? I googled a lot but could not find an effective answer. Any help would be greatly appreciated.
My first attempt would be to add the login view directly to the Ext.Viewport instead of pushing into the navigationView. Then, once the login process is completed, you have to destroy the login view so you can add the navigationView to the Viewport.
This way the login view wont be in the navigationView stack.
Hope it helps-

Resources