Skip to content

Fix/notification dropdown outside click#265

Open
kavin553 wants to merge 3 commits into
mayo-byte07:mainfrom
kavin553:fix/notification-dropdown-outside-click
Open

Fix/notification dropdown outside click#265
kavin553 wants to merge 3 commits into
mayo-byte07:mainfrom
kavin553:fix/notification-dropdown-outside-click

Conversation

@kavin553

Copy link
Copy Markdown

Pull Request Template

Description

Fixed the mega dropdown state synchronization issue caused by scroll interactions and duplicate dropdown close logic.

Fixes #


Changes Made

  • Removed duplicate "closeMegaDropdown()" helper that only updated DOM state.
  • Centralized dropdown close behavior using "closeDD()".
  • Moved mobile scroll auto-close logic inside "initMegaDropdown()".
  • Fixed DOM and JavaScript state desynchronization.
  • Prevented dropdown flickering and stuck open/closed states.
  • Preserved desktop dropdown stability during scroll.
  • Improved component encapsulation and state management.

Screenshots (if applicable)

Before

  • Dropdown sometimes required double click to reopen.
  • Flickering during scroll.
  • Outside click behavior inconsistent.
  • Dropdown state could become stuck.

After

  • Dropdown opens/closes consistently.
  • No flickering during scroll.
  • Outside click works correctly.
  • Mobile scroll closes dropdown properly.
  • State remains synchronized.

(Add screenshots here)


Checklist

  • I have linked the relevant issue above.
  • I have tested my changes locally.
  • My code follows the project's style guidelines.

@vercel

vercel Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

@kavin553 is attempting to deploy a commit to the Mayo's projects Team on Vercel.

A member of the Team first needs to authorize it.

@kavin553

Copy link
Copy Markdown
Author

Hi @maintainer, 👋

Implemented the mega dropdown state synchronization fix and completed local testing successfully.

Fix Summary

  • Removed duplicate dropdown close logic
  • Centralized closing behavior through "closeDD()"
  • Fixed DOM/JS state desynchronization
  • Prevented flickering and double-click reopen issues
  • Preserved correct mobile scroll auto-close behavior
  • Improved dropdown encapsulation and maintainability

Tested

  • Desktop dropdown interactions
  • Outside click behavior
  • Escape key handling
  • Mobile scroll interactions
  • Rapid open/close toggling

Everything is now stable and synchronized across desktop and mobile interactions.

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.

1 participant