+
-
- { currentValue }
-
- ({ selectedServerName })
-
- ;
- }
-
- return
+ { currentValue } ({ selectedServerName })
+
+
{ content }
-
;
+ >;
};
export default NetworkDropdown;
diff --git a/src/components/views/elements/AccessibleButton.tsx b/src/components/views/elements/AccessibleButton.tsx
index 3db6d0dfb05..0bc82f2f812 100644
--- a/src/components/views/elements/AccessibleButton.tsx
+++ b/src/components/views/elements/AccessibleButton.tsx
@@ -42,7 +42,7 @@ type AccessibleButtonKind = | 'primary'
* implemented exactly like a normal onClick handler.
*/
interface IProps extends React.InputHTMLAttributes {
- inputRef?: React.Ref;
+ inputRef?: React.RefObject | React.ForwardedRef | React.LegacyRef;
element?: keyof ReactHTML;
// The kind of button, similar to how Bootstrap works.
// See available classes for AccessibleButton for options.
@@ -58,7 +58,7 @@ interface IProps extends React.InputHTMLAttributes {
}
interface IAccessibleButtonProps extends React.InputHTMLAttributes {
- ref?: React.Ref;
+ ref?: React.RefObject | React.ForwardedRef | React.LegacyRef;
}
/**
@@ -133,9 +133,6 @@ export default function AccessibleButton({
};
}
- // Pass through the ref - used for keyboard shortcut access to some buttons
- newProps.ref = inputRef;
-
newProps.className = classnames(
"mx_AccessibleButton",
className,
@@ -146,6 +143,10 @@ export default function AccessibleButton({
},
);
+ if (inputRef) {
+ newProps.ref = inputRef;
+ }
+
// React.createElement expects InputHTMLAttributes
return React.createElement(element, newProps, children);
}
diff --git a/test/components/structures/__snapshots__/ThreadPanel-test.tsx.snap b/test/components/structures/__snapshots__/ThreadPanel-test.tsx.snap
index 6c3d1db26d0..12c4dcd32aa 100644
--- a/test/components/structures/__snapshots__/ThreadPanel-test.tsx.snap
+++ b/test/components/structures/__snapshots__/ThreadPanel-test.tsx.snap
@@ -7,7 +7,7 @@ exports[`ThreadPanel Header expect that All filter for ThreadPanelHeader properl
Threads
-
Show: All threads
-
+
`;
@@ -29,7 +29,7 @@ exports[`ThreadPanel Header expect that My filter for ThreadPanelHeader properly
Threads
-
Show: My threads
-
+
`;