Blueprint: Suggest dropdown does not open when inputRef is set to ref hook

Created on 20 May 2020  路  9Comments  路  Source: palantir/blueprint

Environment

Repro code sandbox

Steps to reproduce

  1. Click on the Suggest --> App crashes with error core_1.Utils.getRef is not a function
  2. Change @blueprintjs/core version from 3.27.0 to 3.26.1 --> works
P2 select bug help wanted

All 9 comments

Your code sandbox works for me if I also upgrade the other packages, datetime and icons:

image

Can you check if you have multiple versions of core getting installed?

Indeed. I came to this while trying to reproduce a separate issue: when adding an inputRef prop to the Suggest component, the popover no longer shows when clicking on the input.
Should I edit the original post or create a new issue?

Maybe code sandbox is doing something weird where it doesn't respect dependency version ranges? select 3.13.0 explicitly depends on core 3.27.0, where Utils.getRef was introduced:

https://github.com/palantir/blueprint/blob/d08244b8b89b5acc1e4844230fbe01434ec39e8d/packages/select/package.json#L38

any chance you could share a more realistic repro of the issue outside of the sandbox?

when adding an inputRef prop to the Suggest component, the popover no longer shows when clicking on the input.

I'll look into this right now; I just made some changes to that code so I'll make sure it works before I release today.

Adding an inputRef to Suggest works fine for me on the latest develop branch. keep an eye out for a release today

Thanks. Seems like the bug is still present though, both on my local env and on codesandbox (updated the packages to yesterday's release).
I noticed that on Firefox the popover doesn't show at all but on Chrome it appears and disappears within like 0.1s.

Ok, I can repro the new problem in code sandbox with the latest packages: https://codesandbox.io/s/blueprint-sandbox-9w34k

The bug occurs with React.useRef, not with a callback ref. Latest docs site works fine.

I'm not sure what's happening here, but I can definitely repro the issue with the new feature added in select 3.13.0. Callback refs still work, so it's not a regression. Maybe @tanmoyopenroot (who submitted #4093) can take a look?

Hope you don't mind I updated this issue title and description @tdehollain

I'm not sure what's happening here, but I can definitely repro the issue with the new feature added in select 3.13.0. Callback refs still work, so it's not a regression. Maybe @tanmoyopenroot (who submitted #4093) can take a look?

I am looking into it.

Was this page helpful?
0 / 5 - 0 ratings