diff options
author | Ajay <[email protected]> | 2023-12-22 13:04:28 -0500 |
---|---|---|
committer | Ajay <[email protected]> | 2023-12-22 13:04:28 -0500 |
commit | 58d503636324b29269957410e060571e387c24b9 (patch) | |
tree | 6d771d3ee87918a33a635033d80d04a3b8d86f37 | |
parent | 67c2a5bae76e8c81a6075f4becacead42568c18e (diff) | |
download | SponsorBlock-58d503636324b29269957410e060571e387c24b9.tar.gz SponsorBlock-58d503636324b29269957410e060571e387c24b9.zip |
Make unskipping by keybind easier for multiple segment notices by focusing by default
Clicking tab will focus the next button allowing you to unskip the next segment
-rw-r--r-- | src/components/SkipNoticeComponent.tsx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/components/SkipNoticeComponent.tsx b/src/components/SkipNoticeComponent.tsx index 7487bdc5..f571035e 100644 --- a/src/components/SkipNoticeComponent.tsx +++ b/src/components/SkipNoticeComponent.tsx @@ -388,6 +388,7 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta style={{opacity: this.getSubmissionChooserOpacity(i), color: this.getSubmissionChooserColor(i)}} onClick={() => this.performAction(i)} + autoFocus={i == 0} key={"submission" + i + this.segments[i].category + this.idSuffix}> {`${(i + 1)}. ${chrome.i18n.getMessage("category_" + this.segments[i].category)} (${getFormattedTime(this.segments[i].segment[0])})`} @@ -459,6 +460,15 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta if (this.segments.length === 1) { this.performAction(0, action); } else { + if (this.state.smaller) { + this.setState({ + smaller: false + }); + + this.noticeRef.current.fadedMouseEnter(); + this.noticeRef.current.resetCountdown(); + } + switch (action ?? this.state.actionState) { case SkipNoticeAction.None: this.resetStateToStart(); |