惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

美团技术团队
W
WeLiveSecurity
Stack Overflow Blog
Stack Overflow Blog
L
LangChain Blog
S
SegmentFault 最新的问题
Apple Machine Learning Research
Apple Machine Learning Research
Google DeepMind News
Google DeepMind News
F
Full Disclosure
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The Register - Security
The Register - Security
G
Google Developers Blog
C
Check Point Blog
GbyAI
GbyAI
A
About on SuperTechFans
V
Vulnerabilities – Threatpost
T
The Blog of Author Tim Ferriss
T
Tor Project blog
AWS News Blog
AWS News Blog
Cyberwarzone
Cyberwarzone
C
CERT Recently Published Vulnerability Notes
MongoDB | Blog
MongoDB | Blog
Latest news
Latest news
aimingoo的专栏
aimingoo的专栏
U
Unit 42
Y
Y Combinator Blog
P
Privacy International News Feed
Cisco Talos Blog
Cisco Talos Blog
S
Securelist
S
Schneier on Security
雷峰网
雷峰网
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Attack and Defense Labs
Attack and Defense Labs
P
Proofpoint News Feed
C
Cisco Blogs
Webroot Blog
Webroot Blog
T
Troy Hunt's Blog
Google Online Security Blog
Google Online Security Blog
月光博客
月光博客
P
Privacy & Cybersecurity Law Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
罗磊的独立博客
Cloudbric
Cloudbric
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Hacker News: Ask HN
Hacker News: Ask HN
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园 - 司徒正美
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Microsoft Security Blog
Microsoft Security Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
The Ins and Outs of Closings
ShaynaProductions · 2026-06-18 · via DEV Community

Prologue

A while ago, I decided to develop a fully accessible main navigation component in React and write a series of articles documenting the steps it took to create a non-trivial accessible component.

In my last development article, I finally completed keyboard handling for both screen and screen reader users by implementing the last enhancement: sending focus to the top row when entering the component with Shift+Tab.

The foundational support for closing sub-lists when their parent closes was also set up and can now be made use of when closing a list or the component.


Note: This article is one of a series demonstrating building a React navigational component from scratch while considering accessibility through the process. The articles are accompanied by a GitHub repository with releases tied to one or more articles; each builds on the previous one until a fully implemented navigation component is complete.

Each release and its associated tag contain fully runnable code for the article. The code discussed in this article is available in the release. and may be downloaded at release 0.9.0. Links in the article will take you to the proper file in the tagged GitHub Repository.

Because the code for this release is scattered across components, line numbers are added to make it easier to locate in the linked GitHub file. Line numbers are also provided for those who would like to follow along with a downloaded copy.

While code examples are written in JavaScript for brevity, all actual code is written in Typescript and targets React 19.x, all while using vanilla CSS. Examples use Next.js v16.x, which is not required to run the navigation component.

You can view the requirements for the Closings and Exit Release along with previous requirements.


Content Links

  • Introduction
  • Acceptance Criteria
  • Closing Sublists on Parent Close
  • Top Row
  • Close Component
    • Close on Escape
    • Close on Click
  • Summary

Introduction

With keyboard navigation for the desktop menu complete, attention can finally turn to fine-tuning, specifically, the myriad of ways the component needs to handle closing.

When a subnavigation button is toggled, any open children in the list should also close. Open sublists on the top row should close when focus moves to another subnavigation button on the top row. Any open sublists should also close when focus shifts to an element outside the component, regardless of how it happens.

The ARIA Authoring Practices Guide pattern for disclosure navigation explains what happens when closing a component with the Escape key, which, although not detailed, provides a clue about how a component should behave whenever the focus shifts outside the component.

Return to Content Links

Acceptance Criteria

Closings and Exits Release

  • AC 1 - Closing a subnavigation list also closes any open lists nested within.
  • AC 2 - When navigating along the top row, any open sublists close when focus shifts.
  • AC 3 - When Escape is pressed anywhere in the navigation component, all open sublists close and focus shifts to the topmost parent.
  • AC 4 - Any open sublist closes when a pointing device clicks anything outside of the component.
  • AC 5 - Any open sublist closes when focus leaves the component.

A plain-English interpretation is that when a parent list closes, any open sublists within it also close. An open sublist on the top row closes when focus shifts along the top row, and all open sublists should close when focus shifts out of the component by any means.

The issues can be observed in this YouTube video.

Return to Content Links

Closing Sublists on Parent Close

AC 1

  • Closing a subnavigation list also closes any open lists nested within.

Closing nested subnavigation lists upon a parent's close meets screen users' expectations. It's a necessary refinement and the first closing to cover.

Nested lists in React mean nested components, and while a Subnavigation component can close its own list, how does it know which nested lists are open, and how can it trigger a close on those lists?

In my previous article, Focus Issues and Refinement Support, I stored each sublist's closeSubNavigation function in a Map object, which is itself held in a ref object. These functions are included in the return value when the getNavigationArray function is called.

SubNavigation

const closeSubNavigation = useCallback(() => {
    if (buttonRef.current) {
        handleCloseSubNavigation(buttonRef.current);
        setIsSubListOpen(false);
    }
}, [handleCloseSubNavigation]);

GitHub (release 0.9.0) - useNavigation.tsx - closeSubNavigation() - Line 70

The only component holding the closing information is SubNavigation, so the existing closeSubNavigation function is modified to call a navigation hook function, handleCloseSubNavigation, instead of the setIsListOpen call from the hook.

UseNavigation

const handleCloseSubNavigation = (buttonEl) => {
    const dispatchArray = _getElementsInList(buttonEl);
    for (const dispatchObj of dispatchArray) {
        const { dispatchSubListClose, storedParentEl, isSubListOpen } =
            dispatchObj;
        if (isSubListOpen && storedParentEl && dispatchSubListClose) {
            dispatchSubListClose();
        }
    }
    setIsListOpen(false, buttonEl);
};

GitHub (release 0.9.0) - useNavigation.tsx - handleCloseSubNavigation() - Line 439

The hook function handleCloseSubNavigation creates an array of any button elements in the sublist controlled by the triggering button, then loops through them, running the closeSubNavigation function if the sublist is open. The function triggers a cascade when child sublists have their own open lists.

const _getControllingElementsInList = (parentEl) => {
    const controllingListItems = [];
    const { storedList } = _getNavigationObjectByParent(parentEl);

    storedList.forEach((item) => {
        if (item.type === "button") {
            const currentObj = _getNavigationObjectByParent(
                item as ControllingElementType,
            );
            controllingListItems.push(currentObj);
        }
    });
    return controllingListItems;
};

GitHub (release 0.9.0) - useNavigation.tsx -_getControllingElementsInList() - Line 68

Within the parent's stored list, any controlling elements (i.e., type="button") retrieve their associated navigation object. This object is then pushed into the array to be returned to the handleCloseSubNavigation function.

With this code in place, any button with an open list will close itself and any open sublists when triggered.

Top Row

Close Open Siblings on Focus

AC 2

  • When navigating along the top row, any open sublists close when the parent button loses focus.

The Disclosure Navigation Menu Pattern example of the ARIA Practice Guide demonstrates, but does not document a requirement that open sublists on the top row close when focus shifts. This is once again a refinement that users expect.

It's necessary to use the onFocus event to handle this requirement, regardless of whether the event is triggered on a link or on a button.

SubNavigation

const handleFocus = () => {
    handleButtonFocus(buttonRef.current!);
};

GitHub (release 0.9.0) - SubNavigation.tsx - handleButtonFocus () - Line 124

To achieve parity, a handleButtonFocus function is called from the hook, mimicking the handleLinkFocus called from NavigationItem.

useNavigation

const handleButtonFocus = ( buttonEl) => {
    if (_isElementInTopRow(buttonEl)) {
        _handleTopRowItemFocus(buttonEl);
    }
};

const handleLinkFocus = ( linkEl ) => {
    if (_isLastElementInComponent(linkEl)) {
    ...
    } else if (_isElementInTopRow(linkEl)) {
        _handleTopRowItemFocus(linkEl);
    }
};

GitHub (release 0.9.0) - useNavigation.tsx - handleButtonFocus() /handleLinkFocus() - Line 452

Both functions add a call to _handleTopRowItemFocus if and only if the element passed through is in the top row.

const _handleTopRowItemFocus = ( focusedEl ) => {
    _closeOpenSiblings(focusedEl);
};

GitHub (release 0.9.0) - useNavigation.tsx - _handleTopRowItemFocus() - Line 187

Since the focused element will always be on the top row, the only call at the moment is to close any open siblings.

const _closeOpenSiblings: UseNavigationInternalTypes["_closeOpenSiblings"] = (focusedEl,) => {
    const siblingList = getNavigationArray()[0].storedList;

    siblingList.forEach((siblingEl) => {
        if (siblingEl !== focusedEl && siblingEl.type === "button") {
            const {isSubListOpen, dispatchSubListClose} = _getNavigationObjectByParent(siblingEl);
            if (isSubListOpen && dispatchSubListClose) {
                dispatchSubListClose();
            }
        }
    });
};

GitHub (release 0.9.0) - useNavigation.tsx - _closeOpenSiblings() - Line 171

The _closeOpenSiblings function retrieves the elements from the top-row list and calls the stored closing function only if the sublist is open and not the list associated with the current button.

Gif animation demonstrating open sublists closing when focus moves on the top row.

The GIF animation demonstrates the result: open sublists close when focus shifts to another button or link on the top row.

Close Component

For the moment, closing a component means making sure all open sublists are closed when interactions leave the component. There are three different scenarios when this happens:

  1. When the Escape key is pressed while on a focusable element within the component.
  2. When a pointer event is triggered outside of the component;
  3. When focus leaves the component.

Close on Escape

AC 3

  • When Escape is pressed anywhere in the navigation component, all open sublists close and focus shifts to the topmost parent.

Whether focus is on a link or a button in the component, pressing Escape should trigger a cascade that closes any open sublists on the top row and sets the focus to the top-most parent of the currently focused element.

The easiest way to do this is to pass the necessary information to the common key handler, handleCommonKeyDown and let the focus shift happen in there.

export const handleCommonKeyDown = (e, currentlyFocusedEl, CloseComponentWithFocus, ..., shiftFocus) => {
    switch (e.key) {
        case Keys.ESC:
            const closedEl = closeComponentWithFocus(currentlyFocusedEl);
            if (closedEl) {
                shiftFocus(closedEl);
            }
            break;
       ...
    }
};

GitHub (release 0.9.0) - handleCommonKeyDown.ts

Both SubNavigation and NavigationItem send two additional functions down to the handler: CloseComponentWithFocus and shiftFocus.

useNavigation

const closeComponentWithFocus = (focusedEl) => {
    closeComponent();
    return _getTopRowElement(focusedEl as FocusableElementType);
};

GitHub (release 0.9.0) - useNavigation.tsx - closeComponentWithFocus() - Line 275

The closeComponent function is called, and then the ultimate ancestor at the top of the currently focused element's hierarchy is returned.

const closeComponent = () => {
    const { storedList } = _getNavigationObjectByParent(null);
    storedList.map((currentElement) => {
        if (currentElement.type === "button") {
            const { isSubListOpen, dispatchSubListClose } =
                _getNavigationObjectByParent( currentElement );
            if (isSubListOpen && dispatchSubListClose) {
                dispatchSubListClose();
            }
        }
    });
};

GitHub (release 0.9.0) - useNavigation.tsx - closeComponent() - Line 259

The closeComponent function is similar to _closeOpenSiblings, except that all buttons on the top row are triggered to close their open sublists.

Animated Gif showing how open sublists close when Escape is pressed.

Close on Click

AC 4

  • Any open sublists close when a pointing device clicks anything outside of the component.

AC 5

  • Any open sublist closes when focus leaves the component

If the component can be closed with a press of the Escape key, equity demands that it can also be closed by activating a pointing device outside the component, as well as when exiting the component via the Tab key.

There are a number of click-to-close components out there, but not all of them also handle touch and focus events. I forked a stale repository and renamed it OutsideEventListener.

Adding the OutsideEventListener requires the closeComponent function from the navigation hook, but the Navigation component cannot access it because it has no access to the useNavigation hook. Instead, a NavigationWrapper component is called from the original NavigationComponent, and the <nav /> is moved into the wrapper.

export default function Navigation({
    children, cx, isOpen = true, label, orientation = "horizontal", ...rest
}) {
    const parentRef = useRef(null);

    const navigationContextProps = {
        data: {
            isSubListOpen: isOpen, storedParentEl: null, storedList: [],
        },
    };

    const navigationListProps = {
        ...rest, isOpen, orientation, parentRef,
    };

    const navigationWrapperProps = {
        className: cx, label: label,
    };

    return (<>
            <NavigationProvider value={navigationContextProps}>
                <NavigationWrapper {...navigationWrapperProps}>
                    <NavigationList {...navigationListProps}>{children}</NavigationList>
                </NavigationWrapper>
            </NavigationProvider>
        </>);
}

GitHub (release 0.9.0) - Navigation.tsx

Refactoring moved the classes and label from navigationProps to navigationWrapperProps, and the NavigationWrapper component replaces the < nav /> element.


export function NavigationWrapper({
    children, cx, label, ...rest
}: NavigationWrapperProps) {
    const {closeComponent} = useNavigation();

    const navigationProps = {
        "aria-label": label, className: cx, ...rest,
    };

    const outsideElementListenerProps = {
        onOutsideEvent: returnTrueElementOrUndefined(isComponentActive(), closeComponent,),
    };

    return (<OutsideEventListener {...outsideElementListenerProps}>
            <nav {...navigationProps}>{children}</nav>
        </OutsideEventListener>);
}

GitHub (release 0.9.0) - NavigationWrapper.tsx

The <nav /> element is moved inside the OutsideEventListener, which sends the closeComponent function from the navigation hook to trigger when an outside click or pointer event happens, as well as triggering when focus shifts outside of the component.

Most click-to-close implementations are architected to only be active when the item they are connected to is present and open. That isn't the case with the uncontrolled navigation component, which is present continuously, and I'm uncomfortable with the idea that every click outside it will trigger a close navigation call. This is the scenario that necessitated the fork, ensuring the function can be passed in as undefined when the navigation component isn't active.

IsComponentActive is a flag that determines whether the closeComponent function is sent to the outside event listener. If the flag is false, the function is not passed through, effectively neutering the outside handler.

All that's left is to add the flag and apply the conditions to set it to either true or false.

Adding isComponentActive

The first step is to add the flag into state within the navigation context provider.

const [state, dispatch] = useReducer(navigationReducer, {
    navigationArray: [navigationObject], isComponentActive: false,
});

const isComponentActive = () => {
    return state.isComponentActive;
};

const setIsComponentActive = (isActive) => {
    dispatch({type: "SET_IS_COMPONENT_ACTIVE", isActive});
};

GitHub (release 0.9.0) - NavigationProvider.tsx - Line 28

The flag is added to the state, and two functions are created, one to return the flag and the other to set it via the reducer.

case "SET_IS_COMPONENT_ACTIVE": {
    if (state.isComponentActive === action.isActive) return state;
    return {...state, isComponentActive: action.isActive};
}

GitHub (release 0.9.0) - navigationReducer.ts - Line 14

With the flag now wired in and added to the NavigationWrapper component, the question becomes where to set it. The flag needs to be set to true when the component is first entered, and to false when focus leaves the component. All of this can be accomplished in the various functions within the navigation hook.


const _handleTopRowItemFocus = (focusedEl) => {
    if (isComponentActive()) {
        _closeOpenSiblings(focusedEl);
    } else {
        setIsComponentActive(true);
    }
};

GitHub (release 0.9.0) - useNavigation - _handleTopRowItemFocus() /handleLinkFocus() - Line 187

When a component is inactive, the only focusable elements available are on the top row. In this case, the call to close any open siblings only needs to happen if the component is already active, and if it isn't, the component is set to active.

A top-row focus can be triggered by a pointer action on a button or by keyboard navigation.

const closeComponent = () => {
    const {storedList} = _getNavigationObjectByParent(null);
    storedList.map((currentElement) => {
        if (currentElement.type === "button") {
            const {isSubListOpen, dispatchSubListClose} = _getNavigationObjectByParent(currentElement as ControllingElementType,);
            if (isSubListOpen && dispatchSubListClose) {
                dispatchSubListClose();
            }
        }
    });
    setIsComponentActive(false);
};

GitHub (release 0.9.0) - useNavigation - closeComponent() - Line 259

The logical place to set the component to an inactive state is, of course, in the closeComponent function.

And with this last piece of code in place, it's time to declare the horizontal uncontrolled navigation component complete! (celebration emoji)

That's not to say the work is finished; if you recall, the requirements required the navigation component to also work as a mobile menu, which means passing through a controlling reference and ensuring the keyboard works as expected in that environment. You can see the issues in this video.

Summary

Accessibility and usability can go hand in hand by ensuring reasonable user expectations are met. Since every user expects components to clean up and reset to a pristine state when they are no longer in use, spending time refining the navigation component to handle these closures is well worth it.

All that's left to do is make sure this component functions when controlled and meets user expectations when navigating a vertical top row rather than a horizontal one.