You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My motivation for wanting a way to reference the underlying HTML elements of the Dropdown components is to enhance the scrolling functionality of my DropdownMenu implementation.
I have added arrow buttons to the top and bottom of my DropdownMenu that appear when there is hidden content in those directions. When clicked, I want these buttons to cause the the DropdownMenu to scroll in that direction by a certain amount.
I have the behaviour working using ReactDOM.findDOMNode but I would like to use a callback ref instead (coming from the discussion in this issue).
I believe a simple solution is for the DropdownMenu component to accept an onRef prop that forwards to the Component (seen below), something like ref={this.props.onRef} underneath style={style}:
The text was updated successfully, but these errors were encountered:
christopherbot
changed the title
No way to obtain refs to the underlying HTML elements
No way to obtain refs to the underlying HTML elements without ReactDOM.findDOMNodeMay 24, 2019
My motivation for wanting a way to reference the underlying HTML elements of the
Dropdown
components is to enhance the scrolling functionality of myDropdownMenu
implementation.I have added arrow buttons to the top and bottom of my
DropdownMenu
that appear when there is hidden content in those directions. When clicked, I want these buttons to cause the theDropdownMenu
to scroll in that direction by a certain amount.I have the behaviour working using
ReactDOM.findDOMNode
but I would like to use a callback ref instead (coming from the discussion in this issue).I believe a simple solution is for the
DropdownMenu
component to accept anonRef
prop that forwards to theComponent
(seen below), something likeref={this.props.onRef}
underneathstyle={style}
:react-dropdown/src/DropdownMenu.jsx
Lines 113 to 122 in abede6c
Are you open to something like this?
The text was updated successfully, but these errors were encountered: