Skip to content

[Feature Request]: Enable linking to dropdowns #1759

Closed as not planned
Closed as not planned

Description

@wajihaparvez

What problem are you trying to solve?

I want to link to specific dropdowns from other pages + PMs want to send customers to specific dropdowns rather than having them scan a whole page. Can we get the ability to add custom anchors to dropdowns?

See slack thread here.

How important is this feature to you?

Nice to have

Activity

  1. self-assigned this
    on Aug 22, 2025
  2. KOTungseth commented on May 14, 2026

    @KOTungseth
    Contributor

    @theletterf do we have a status on this?

  3. theletterf commented on May 16, 2026

    @theletterf
    Member

    Nope. PR was mothballed.

  4. technige commented on May 18, 2026

    @technige
    Contributor

    @theletterf can we move this out of "in progress"?

  5. theletterf commented on May 18, 2026

    @theletterf
    Member

    Indeed! Moved to Backlog.

  6. removed their assignment
    on May 19, 2026
  7. cotti commented on Jun 3, 2026

    @cotti
    Contributor

    AI triage

    Automated investigation against the current codebase. A human still needs to confirm before any code change.

    Original concern

    Authors/PMs want to deep-link to a specific {dropdown} so a URL fragment scrolls to and expands that dropdown — i.e. custom anchors on dropdowns.

    Findings

    • src/Elastic.Markdown/Myst/Directives/Admonition/AdmonitionBlock.cs:41 — the dropdown directive already reads a :name: option into CrossReferenceName (DropdownBlock derives from AdmonitionBlock, line 10).
    • src/Elastic.Markdown/Myst/Directives/Dropdown/DropdownView.cshtml:3 — that value is emitted as the id on the <details> element: <details class="dropdown ..." id="@Model.CrossReferenceName" ...>. So :::{dropdown} Title + :name: my-anchor renders <details id="my-anchor">, and page#my-anchor already targets it. There is no auto-generated id when :name: is omitted.
    • src/Elastic.Documentation.Site/Assets/open-details-with-anchor.ts:7-23 — on navigation, if window.location.hash resolves to an element whose closest('details') exists, it sets closestDetails.open = true and scrolls to it — but only for non-Chrome browsers (line 13); Chrome is assumed to handle this natively. Wired up on every page load via main.ts:122 (openDetailsWithAnchor() in the htmx:load handler).
    • docs/syntax/dropdowns.md (whole file) — documents open and applies_to but not :name:, so the existing anchor capability is effectively undiscoverable to writers.
    • Unlike headings and code blocks (e.g. src/Elastic.Markdown/Myst/CodeBlocks/Code.cshtml:8 renders a headerlink), the dropdown title has no visible/copyable anchor link, so even where an id exists there's no UI to grab the deep link.

    Verdict

    Partially done

    The underlying mechanism already exists: a dropdown with :name: renders a stable id, and a frontend shim expands the <details> when you land on its fragment (non-Chrome; Chrome relied upon natively). What's missing is the user-visible polish that makes this a real feature: :name: is undocumented, there's no auto-generated anchor, and there's no clickable/copyable anchor affordance on the dropdown title. The dedicated work for exactly this — PR #1765 ("Add deeplink anchors to dropdown directive", branch add-deeplink-anchors-dropdown) — was closed unmerged on 2026-02-11 (the "mothballed PR" referenced in the thread); it turned the inherited :name: into a title anchor link and added docs, but deliberately omitted a visual indicator to avoid "polluting the design." That design tension is why this isn't a clean quick fix.

    Proposal

    Open decisions, grouped by audience:

    • UX — Should the dropdown title expose a copyable anchor affordance (a headerlink like headings/code blocks, a hover icon, or click-title-to-copy), or stay invisible as PR Add deeplink anchors to dropdown directive #1765 chose? This is the call that stalled Add deeplink anchors to dropdown directive #1765. Should the dropdown also auto-open + smooth-scroll consistently in Chrome (the shim currently skips Chrome)?
    • Eng — Decide whether to auto-generate stable ids for dropdowns (slug from title) vs. requiring :name:, and how to keep them stable/unique across edits. Confirm cross-browser open-on-hash behavior: the shim only fires for non-Chrome (open-details-with-anchor.ts:13) and assumes Chrome's native behavior — worth verifying against current Chrome plus find-in-page interplay. If reviving PR Add deeplink anchors to dropdown directive #1765, rebase it onto current main.

    Smaller, lower-risk follow-up regardless of the above: document the existing :name: option in docs/syntax/dropdowns.md so authors can use the capability that already ships.

    Related issues

    Part of a dropdown cluster: #1261 (Dropdown improvements, open) and #1280 (Improve accordion ES|QL functions list, open) — both already ai-triaged. #1261 references this issue as related. Maintainers may want to plan a coherent dropdown UX pass across all three.

    Notes

    • Mothballed fix: PR #1765 (CLOSED, not merged, 2026-02-11). Its branch origin/add-deeplink-anchors-dropdown still exists on the remote and could be rebased/reopened rather than rewritten from scratch.
    • Suggested follow-up issue (for a human to confirm): a doc-only task to document :name: for dropdowns, decoupled from the contentious anchor-UI decision.
  8. added
    ai-triaged
    ai:ux-question
    ai:eng-question
    on Jun 3, 2026
  9. github-actions commented on Sep 14, 2026

    @github-actions
    Contributor

    This issue is stale because it has been open 90 days with no activity. Remove the stale label, or leave a comment, or this will be closed in 14 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai-triagedai:eng-questionai:ux-questionclosed-staleenhancementstale

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions