alex-cory/react-useportal

Portal closes when using React Select

rijk opened this issue · 11 comments

rijk commented

Hi again! Check out https://codesandbox.io/s/useportal-mcev3 -> when using the popular react-select with default options, the Portal closes when selecting an option through mouse click. It doesn't happen when using the closeMenuOnSelect parameter. Strange thing is it also doesn't happen when selecting an option via keyboard.

Any idea what is happening here?

looking at it now!

I know where it's failing, trying to figure out the solution.
image
This is what's happening:

  1. click on the Select
    • outside mouse click
  2. select option
    • ouside mouse click
    • close portal

Basically I just gotta figure out why the Select is getting treated as though it's outside the Portal

rijk commented

Yeah, I figured it was something like that. The Select's menu is inside of the Portal's DOM though. It is added dynamically (when opening the dropdown), maybe this has something to do with it?

apologies this is taking so long. I've been crazy busy moving and fixing up my house. Taking another look now

rijk commented

Hopefully you still use this :( sorry I've been taking so long to get this done. Lots of things going on in my life and hard to keep up with everything. I'll be taking a look at this Monday as main focus. If you want to try to debug it yourself (which shouldn't be too hard) with this codesandbox, feel free. Otherwise it'll have to wait until Monday.

Also, I'm down to pair program if you're ever interested

rijk commented

Hi Alex, absolutely no need to feel bad! It's great that you put this package up, and I am the one that should feel bad for not doing a PR. I tried to debug/fix, but struggled to get it running because of the Typescript (I am using Meteor and it is difficult to get the TS compiler wired in to the build tool). So I gave up on that and instead coded something custom, as my needs were relatively simple and also I was using Modals in a controlled way (where I pass an open prop).

dangg :( All good. I've been spread so thin between work, and usePortal and useFetch. Hard to get it all done

rijk commented

I know what it's like. Take care!

This issue has been fixed in v1.0.2