Fix hotkeys firing for multiple elements

This is due to react-hotkeys-hook v4.5.1 upgrade
This commit is contained in:
Lim Chee Aun 2024-09-15 23:41:18 +08:00
parent 894bfcc891
commit b1d7592673
5 changed files with 17 additions and 17 deletions

View file

@ -72,7 +72,7 @@ function Modal({ children, onClose, onClick, class: className, minimized }) {
<div <div
ref={(node) => { ref={(node) => {
modalRef.current = node; modalRef.current = node;
escRef.current = node?.querySelector?.('[tabindex="-1"]') || node; escRef(node?.querySelector?.('[tabindex="-1"]') || node);
}} }}
className={className} className={className}
onClick={(e) => { onClick={(e) => {

View file

@ -1519,11 +1519,11 @@ function Status({
node?.closest?.( node?.closest?.(
'.timeline-item, .timeline-item-alt, .status-link, .status-focus', '.timeline-item, .timeline-item-alt, .status-link, .status-focus',
) || node; ) || node;
rRef.current = nodeRef; rRef(nodeRef);
fRef.current = nodeRef; fRef(nodeRef);
dRef.current = nodeRef; dRef(nodeRef);
bRef.current = nodeRef; bRef(nodeRef);
xRef.current = nodeRef; xRef(nodeRef);
}} }}
tabindex="-1" tabindex="-1"
class={`status ${ class={`status ${

View file

@ -390,10 +390,10 @@ function Timeline({
}`} }`}
ref={(node) => { ref={(node) => {
scrollableRef.current = node; scrollableRef.current = node;
jRef.current = node; jRef(node);
kRef.current = node; kRef(node);
oRef.current = node; oRef(node);
dotRef.current = node; dotRef(node);
}} }}
tabIndex="-1" tabIndex="-1"
onClick={(e) => { onClick={(e) => {

View file

@ -842,10 +842,10 @@ function Catchup() {
<div <div
ref={(node) => { ref={(node) => {
scrollableRef.current = node; scrollableRef.current = node;
jRef.current = node; jRef(node);
kRef.current = node; kRef(node);
hlRef.current = node; hlRef(node);
escRef.current = node; escRef(node);
}} }}
id="catchup-page" id="catchup-page"
class="deck-container" class="deck-container"

View file

@ -477,9 +477,9 @@ function Notifications({ columnMode }) {
class="deck-container" class="deck-container"
ref={(node) => { ref={(node) => {
scrollableRef.current = node; scrollableRef.current = node;
jRef.current = node; jRef(node);
kRef.current = node; kRef(node);
oRef.current = node; oRef(node);
}} }}
tabIndex="-1" tabIndex="-1"
> >