Skip to content

Commit 1b0f597

Browse files
Merge pull request #635 from OneNoteDev/claude/issue-628-20260225-0907
A11y Bug 8780715 : add keyboard focus to success panel and region selecting panel
2 parents 4d89853 + d1df05f commit 1b0f597

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/scripts/clipperUI/panels/regionSelectingPanel.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ import {ClipperStateProp} from "../clipperState";
44
import {ComponentBase} from "../componentBase";
55

66
class RegionSelectingPanelClass extends ComponentBase<{}, ClipperStateProp> {
7+
initiallySetFocus(element: HTMLElement) {
8+
element.focus();
9+
}
10+
711
handleCancelButton() {
812
this.props.clipperState.setState({
913
focusOnRender: Constants.Ids.regionButton
@@ -28,6 +32,7 @@ class RegionSelectingPanelClass extends ComponentBase<{}, ClipperStateProp> {
2832
</div>
2933
<div className="wideButtonContainer">
3034
<a id={ Constants.Ids.regionClipCancelButton } role="button"
35+
{...this.onElementFirstDraw(this.initiallySetFocus)}
3136
{...this.enableInvoke({callback: this.handleCancelButton, tabIndex: 0})} >
3237
<span className="wideButtonFont wideActionButton buttonTextInHighContrast" style={Localization.getFontFamilyAsStyle(Localization.FontFamily.Semibold)}>
3338
{Localization.getLocalizedString("WebClipper.Action.BackToHome")}

src/scripts/clipperUI/panels/successPanel.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ import {Clipper} from "../frontEndGlobals";
1414
import {SpriteAnimation} from "../components/spriteAnimation";
1515

1616
class SuccessPanelClass extends ComponentBase<{ }, ClipperStateProp> {
17+
initiallySetFocus(element: HTMLElement) {
18+
element.focus();
19+
}
20+
1721
public onLaunchOneNoteButton() {
1822
Clipper.logger.logUserFunnel(Log.Funnel.Label.ViewInWac);
1923
let data = this.props.clipperState.oneNoteApiResult.data as OneNoteApi.Page;
@@ -38,6 +42,7 @@ class SuccessPanelClass extends ComponentBase<{ }, ClipperStateProp> {
3842
</div>
3943
<div className="wideButtonContainer">
4044
<a id={Constants.Ids.launchOneNoteButton} className="wideButtonFont wideActionButton buttonTextInHighContrast" role="button"
45+
{...this.onElementFirstDraw(this.initiallySetFocus)}
4146
{...this.enableInvoke({callback: this.onLaunchOneNoteButton, tabIndex: 70})}
4247
style={Localization.getFontFamilyAsStyle(Localization.FontFamily.Regular)}>
4348
{Localization.getLocalizedString("WebClipper.Action.ViewInOneNote")}

0 commit comments

Comments
 (0)