Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Commit 1563a65

Browse files
author
Silviu Avram
committed
Revert "used buttonNode for consistency"
This reverts commit 97758c2.
1 parent c28f7c5 commit 1563a65

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/components/Dropdown/Dropdown.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,9 @@ export default class Dropdown extends AutoControlledComponent<
133133
Extendable<DropdownProps>,
134134
DropdownState
135135
> {
136-
private buttonNode: HTMLElement
137136
private inputNode: HTMLElement
138137
private listNode: HTMLElement
138+
private buttonRef = React.createRef<HTMLElement>()
139139

140140
static displayName = 'Dropdown'
141141

@@ -289,11 +289,7 @@ export default class Dropdown extends AutoControlledComponent<
289289
const content = value && !multiple ? itemToString(value) : placeholder
290290

291291
return (
292-
<Ref
293-
innerRef={(buttonNode: HTMLElement) => {
294-
this.buttonNode = buttonNode
295-
}}
296-
>
292+
<Ref innerRef={this.buttonRef}>
297293
<Button
298294
content={content}
299295
fluid
@@ -669,7 +665,7 @@ export default class Dropdown extends AutoControlledComponent<
669665
return
670666
case keyboardKey.Escape:
671667
accessibilityInputPropsKeyDown(e)
672-
this.buttonNode.focus()
668+
this.buttonRef.current.focus()
673669
return
674670
default:
675671
accessibilityInputPropsKeyDown(e)
@@ -689,7 +685,7 @@ export default class Dropdown extends AutoControlledComponent<
689685
this.setA11yStatus(getA11ySelectionMessage.onAdd(item))
690686
}
691687
if (!search) {
692-
this.buttonNode.focus()
688+
this.buttonRef.current.focus()
693689
}
694690

695691
// we don't have event for it, but want to keep the event handling interface, event is empty.

0 commit comments

Comments
 (0)