fix: prevent event propagation on site icon and logo links #1128
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix Logo/Icon Navigation Behavior
Description
This PR fixes an issue where clicking on the site logo or icon to navigate to the admin index page would first trigger the site dropdown menu before navigating. The fix prevents event propagation when clicking on these navigation elements, ensuring a smoother user experience without changing the visual appearance.
Changes
x-on:click.stopAlpine.js directive to logo and icon links in bothsite_logo.htmlandsite_icon.htmltemplatessite_dropdownis present, maintaining compatibility with configurations that don't use the dropdownProblem Solved
Previously, when a user clicked on the logo or icon to navigate to the admin index page, the click event would:
This created a jarring user experience where the dropdown would briefly appear before navigation occurred. With this fix, clicking on the logo or icon will:
Testing
Tested in various scenarios: