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

View With selector in admin bar not working as expected in Firefox we… #2953

Conversation

MaximilianoRicoTabo
Copy link
Contributor

…b browser.

  • Catch Mouseout event from select#pmpro-admin-membership-access and stop propagation
image

All Submissions:

Changes proposed in this Pull Request:

Catch Mouseout event from select#pmpro-admin-membership-access and stop propagation

Resolves #2907 .

How to test the changes in this Pull Request:

Follow steps from the issue to reproduce it. Apply the patch to check it doesn't any more.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you successfully run tests with your changes locally?

Changelog entry

Enter a summary of all changes on this Pull Request. This will appear in the changelog if accepted.

…b browser.

 * Catch Mouseout event from select#pmpro-admin-membership-access and stop propagation
Copy link
Member

@dparker1005 dparker1005 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried this fix on the 2024 theme. When loading the front page, the issue still occurs and I get this error in the console referencing the code added in this PR:
Uncaught ReferenceError: jQuery is not defined

We would either need to ensure that jQuery is loaded here or make this change with vanilla JS

@MaximilianoRicoTabo
Copy link
Contributor Author

I can't reproduce what you mention @dparker1005 . Also it doesn't make sense to me. jQuery is loaded by WP core, it shouldn't affect which theme we're using.

image

@MaximilianoRicoTabo
Copy link
Contributor Author

MaximilianoRicoTabo commented Apr 15, 2024

Reproduced and updated. Please disregard comment above.

@dparker1005 dparker1005 marked this pull request as draft May 6, 2024 13:58
@dparker1005
Copy link
Member

dparker1005 commented Jun 11, 2024

ChatGPT likes this vanilla JS solution which will avoid the jQuery conflict:
document.addEventListener('DOMContentLoaded', function() {
// Prevent hoverIntent from firing due to propagation from this event.
document.getElementById('pmpro-admin-membership-access').addEventListener('mouseout', function(ev) {
ev.stopPropagation();
});
});

@MaximilianoRicoTabo Can you test this and update the PR if it works?

@dparker1005 dparker1005 added this to the 3.1 milestone Jun 11, 2024
@MaximilianoRicoTabo
Copy link
Contributor Author

I did in April but ut seems like never pushed the commit ! Sorry about that, pushing now.
image

@MaximilianoRicoTabo MaximilianoRicoTabo marked this pull request as ready for review June 11, 2024 18:53
@dparker1005 dparker1005 changed the base branch from dev to v3.1 June 12, 2024 17:17
@dparker1005 dparker1005 merged commit 1a2df69 into strangerstudios:v3.1 Jun 12, 2024
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

Successfully merging this pull request may close these issues.

View With selector in admin bar not working as expected in Firefox web browser.
2 participants