Skip to content

Commit 8769540

Browse files
Fix double focus on article body in Augmentation mode
Use spread operator to conditionally add tabIndex attribute only when shouldPreviewBodyHaveTabIndex() returns true. This prevents the outer previewBody div from having any tabIndex in Augmentation/Selection modes, eliminating the double focus issue where both outer and inner divs were being focused. Co-authored-by: aanchalbhansali <185747873+aanchalbhansali@users.noreply.github.com>
1 parent aef0758 commit 8769540

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/scripts/clipperUI/components/previewViewer/previewComponentBase.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ export abstract class PreviewComponentBase<TState, TProps extends ClipperStatePr
197197
style={previewStyle}
198198
id={Constants.Ids.previewBody}
199199
className={inProgressClassIfApplicable + " " + this.getPreviewBodyClass()}
200-
tabIndex={this.shouldPreviewBodyHaveTabIndex() ? 260 : undefined}
200+
{...(this.shouldPreviewBodyHaveTabIndex() ? { tabIndex: 260 } : {})}
201201
config={(element: HTMLElement, isInitialized: boolean) => {
202202
if (this.shouldPreviewBodyHaveTabIndex()) {
203203
this.makeChildLinksNonTabbable(element, isInitialized);

0 commit comments

Comments
 (0)