Skip to content

Commit e6cf958

Browse files
committed
Remove additional changes
1 parent ed38733 commit e6cf958

2 files changed

Lines changed: 0 additions & 39 deletions

File tree

src/scripts/clipperUI/components/sectionPicker.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,6 @@ export class SectionPickerClass extends ComponentBase<SectionPickerState, Sectio
5454
// If the user selects a section, onPopupToggle will fire because it closes the popup, even though it wasn't a click
5555
// so logging only when they open it is potentially the next best thing
5656
Clipper.logger.logClickEvent(Log.Click.Label.sectionPickerLocationContainer);
57-
// Move focus to the first item in the dropdown when it opens
58-
requestAnimationFrame(() => {
59-
let notebookList = document.getElementById("notebookList");
60-
if (notebookList) {
61-
let firstTreeItem = notebookList.querySelector("li[role='treeitem']") as HTMLElement;
62-
if (firstTreeItem) {
63-
firstTreeItem.focus();
64-
}
65-
}
66-
});
6757
}
6858
this.props.onPopupToggle(shouldNowBeOpen);
6959
if (shouldNowBeOpen) {

src/tests/clipperUI/components/sectionPicker_tests.tsx

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,35 +1119,6 @@ export class SectionPickerSinonTests extends TestModule {
11191119
done();
11201120
});
11211121
});
1122-
1123-
test("onPopupToggle should move focus to first tree item when dropdown opens", (assert: QUnitAssert) => {
1124-
let done = assert.async();
1125-
1126-
let clipperState = MockProps.getMockClipperState();
1127-
let mockNotebooks = MockProps.getMockNotebooks();
1128-
initializeClipperStorage(JSON.stringify(mockNotebooks), undefined, TestConstants.defaultUserInfoAsJsonString);
1129-
1130-
let component = <SectionPicker
1131-
onPopupToggle={() => {}}
1132-
clipperState={clipperState} />;
1133-
MithrilUtils.mountToFixture(component);
1134-
1135-
// Open the dropdown
1136-
MithrilUtils.simulateAction(() => {
1137-
document.getElementById(TestConstants.Ids.sectionLocationContainer).click();
1138-
});
1139-
1140-
// Wait for requestAnimationFrame to complete
1141-
requestAnimationFrame(() => {
1142-
let notebookList = document.getElementById("notebookList");
1143-
ok(notebookList, "Notebook list should be present when dropdown is open");
1144-
if (notebookList) {
1145-
let firstTreeItem = notebookList.querySelector("li[role='treeitem']") as HTMLElement;
1146-
ok(firstTreeItem, "First tree item should exist in the notebook list");
1147-
}
1148-
done();
1149-
});
1150-
});
11511122
}
11521123
}
11531124

0 commit comments

Comments
 (0)