Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Context Menu Enabled on Google Sign-Up/Sign-In Button on chaicode.com #539

Open
mAchyut opened this issue Aug 21, 2024 · 0 comments
Open

Comments

@mAchyut
Copy link

mAchyut commented Aug 21, 2024

Issue Description

Description:
On the sign-up page, the context menu (right-click menu) is successfully disabled for the entire page. However, the context menu still appears when right-clicking on the Google sign-up button. This issue needs to be resolved to ensure a consistent user experience across all elements on the page.

Steps to Reproduce:

  1. Navigate to the sign-up page.
  2. Right-click anywhere on the page to confirm that the context menu is disabled.
  3. Right-click on the Google sign-up button.
  4. Observe that the context menu appears when right-clicking on the Google sign-up button.

Expected Behavior:
The context menu should be disabled for the Google sign-up button, just like it is for the rest of the page.

Actual Behavior:
The context menu appears when right-clicking on the Google sign-up button.

Possible Solution:
Ensure that the context menu is disabled for the Google sign-up button by adding an event listener to prevent the default context menu action.

Code Example 1:
To disable the context menu entirely without any exceptions

document.addEventListener("contextmenu", (e)=>{
e.preventDefault()
return
})

Code Example 2:

  document.addEventListener('contextmenu', function(event) {
      if(event.ctrlKey || event.shiftKey || event.altKey || event.metaKey){
          return;
        }
        event.preventDefault();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant