We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c5ae0ff commit 2d737dcCopy full SHA for 2d737dc
packages/react-core/src/components/Dropdown/examples/DropdownWithSplit.tsx
@@ -14,12 +14,12 @@ export const DropdownSplitButtonText: React.FunctionComponent = () => {
14
const toggleRef = React.useRef<MenuToggleElement>(null);
15
16
const onFocus = () => {
17
- if (toggleRef.current) {
18
- const toggleButton = toggleRef.current.querySelector('button[aria-expanded]');
19
- if (toggleButton) {
20
- (toggleButton as HTMLElement).focus();
21
- }
+ if (!toggleRef.current) {
+ return;
22
}
+
+ const toggleButton = toggleRef.current.querySelector('button[aria-expanded]');
+ toggleButton?.focus();
23
};
24
25
const onSelect = () => {
0 commit comments