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

Suggest dropdown does not open when inputRef is set to ref hook #4138

Closed
tdehollain opened this issue May 20, 2020 · 9 comments
Closed

Suggest dropdown does not open when inputRef is set to ref hook #4138

tdehollain opened this issue May 20, 2020 · 9 comments

Comments

@tdehollain
Copy link

tdehollain commented May 20, 2020

Environment

  • Package version(s): Core@3.27.0, Suggest@3.13.0 core@3.28.0, select 3.13.1
  • Browser and OS versions: Google Chrome 81.0.4044.129, MacOS 10.14.6

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
@adidahiya adidahiya self-assigned this May 20, 2020
@adidahiya adidahiya added the P1 label May 20, 2020
@adidahiya
Copy link
Contributor

adidahiya commented May 20, 2020

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?

@adidahiya adidahiya removed the P1 label May 20, 2020
@tdehollain
Copy link
Author

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?

@adidahiya
Copy link
Contributor

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:

"@blueprintjs/core": "^3.27.0",

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

@adidahiya
Copy link
Contributor

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.

@adidahiya
Copy link
Contributor

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

@tdehollain
Copy link
Author

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.

@adidahiya
Copy link
Contributor

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.

@adidahiya adidahiya changed the title Suggest 3.13.0 not working with Core 3.27.0 Suggest dropdown does not open when inputRef is set to ref hook May 22, 2020
@adidahiya adidahiya removed their assignment May 22, 2020
@adidahiya
Copy link
Contributor

adidahiya commented May 22, 2020

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

@tanmoyopenroot
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants