From d5b0cd84c403ce2dd27f0a352e309e36f8abe873 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 1 Feb 2026 14:23:11 +0000 Subject: [PATCH 1/5] Initial plan From ffa0bbf381edcd1f6b390e00385d60ffe39c542f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 1 Feb 2026 14:26:54 +0000 Subject: [PATCH 2/5] Initial exploration of the location dropdown focus issue Co-authored-by: aanchalbhansali <185747873+aanchalbhansali@users.noreply.github.com> --- package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 13e4015b..50484e77 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25001,7 +25001,7 @@ "requires": { "debuglog": "^1.0.1", "dezalgo": "^1.0.0", - "graceful-fs": "4.2.2", + "graceful-fs": "^4.1.2", "once": "^1.3.0" } }, From ef649def58c29dc49f5b5799826e0838c6200f3f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 1 Feb 2026 14:28:28 +0000 Subject: [PATCH 3/5] Add ESC key focus restoration to location dropdown Co-authored-by: aanchalbhansali <185747873+aanchalbhansali@users.noreply.github.com> --- .../clipperUI/components/sectionPicker.tsx | 39 ++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/src/scripts/clipperUI/components/sectionPicker.tsx b/src/scripts/clipperUI/components/sectionPicker.tsx index 43339d23..3e8d770d 100644 --- a/src/scripts/clipperUI/components/sectionPicker.tsx +++ b/src/scripts/clipperUI/components/sectionPicker.tsx @@ -29,6 +29,8 @@ interface SectionPickerProp extends ClipperStateProp { export class SectionPickerClass extends ComponentBase { static dataSource: OneNotePicker.OneNotePickerDataSource; + private popupIsOpen: boolean = false; + private escWasPressed: boolean = false; getInitialState(): SectionPickerState { return { @@ -54,6 +56,20 @@ export class SectionPickerClass extends ComponentBase { + const sectionLocationContainer = document.getElementById(Constants.Ids.sectionLocationContainer); + if (sectionLocationContainer) { + sectionLocationContainer.focus(); + } + }, 0); + } } this.props.onPopupToggle(shouldNowBeOpen); } @@ -248,6 +264,27 @@ export class SectionPickerClass extends ComponentBase { + if (ev.keyCode === Constants.KeyCodes.esc && this.popupIsOpen) { + // Mark that ESC was pressed so we can restore focus after the popup closes + this.escWasPressed = true; + } + if (oldOnKeyDown) { + oldOnKeyDown.call(document, ev); + } + }; + + // Remove listener when this element is unmounted + context.onunload = () => { + document.onkeydown = oldOnKeyDown ? oldOnKeyDown.bind(document) : undefined; + }; + } + } + render() { if (this.dataSourceUninitialized()) { // This logic gets executed on app launch (if already signed in) and whenever the user signs in or out ... @@ -295,7 +332,7 @@ export class SectionPickerClass extends ComponentBase +