Skip to content

fixed the bug #9098 https://github.com/nodejs/nodejs.org/issues/9098 - #9121

Closed
DakshGautam101 wants to merge 1 commit into
nodejs:mainfrom
DakshGautam101:fix/9098
Closed

fixed the bug #9098 https://github.com/nodejs/nodejs.org/issues/9098#9121
DakshGautam101 wants to merge 1 commit into
nodejs:mainfrom
DakshGautam101:fix/9098

Conversation

@DakshGautam101

Copy link
Copy Markdown

Fix ChangeHistory dropdown not closing on outside click

Summary

Updated the ChangeHistory component to close the dropdown when the user clicks or taps outside of it.

Changes

  • Converted ChangeHistory into a client component using 'use client'.
  • Added a ref to the <details> element to track the dropdown.
  • Added a pointerdown event listener on document.
  • Automatically closes the dropdown when a pointer interaction occurs outside the <details> element.
  • Added proper cleanup of the event listener when the component unmounts.

Why

Previously, the native <details> dropdown could remain open when interacting elsewhere on the page. This change provides the expected dropdown behavior by closing it when the user clicks outside.

Testing

  • Opened the Change History dropdown.
  • Clicked inside the dropdown — it remains open.
  • Clicked outside the dropdown — it closes.
  • Verified that the event listener is removed when the component unmounts.

@DakshGautam101
DakshGautam101 requested a review from a team as a code owner August 31, 2026 08:56
@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nodejs-org Ready Ready Preview Aug 31, 2026 8:57am

Request Review

@DakshGautam101 DakshGautam101 changed the title fixed the bug 9098 fixed the bug #9098 https://github.com/nodejs/nodejs.org/issues/9098 Aug 31, 2026
@avivkeller avivkeller closed this Aug 31, 2026
@avivkeller

Copy link
Copy Markdown
Member

Given the format of this PR, I can only assume our policy on the usage of AI was not followed in it's creation. Please consult that policy before contributing to Node.js.

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.

2 participants