Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: mount scrollTo on ref #298

Merged
merged 15 commits into from
Dec 28, 2020
Prev Previous commit
Next Next commit
fix: the scrollT of treeRef does not necessarily exist
  • Loading branch information
atzcl committed Dec 28, 2020
commit d82ec3a636012ad2962aa708a8288bc06228c63e
2 changes: 1 addition & 1 deletion src/OptionList.tsx
Original file line number Diff line number Diff line change
@@ -192,7 +192,7 @@ const OptionList: React.RefForwardingComponent<
const activeEntity = getEntityByKey(activeKey);

React.useImperativeHandle(ref, () => ({
scrollTo: treeRef.current.scrollTo,
scrollTo: treeRef.current?.scrollTo,
onKeyDown: event => {
const { which } = event;
switch (which) {