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

Can't use menu-buttons inside of a dialog #64

Closed
hedgerh opened this issue Sep 14, 2018 · 4 comments
Closed

Can't use menu-buttons inside of a dialog #64

hedgerh opened this issue Sep 14, 2018 · 4 comments
Labels
Help Wanted Extra attention is needed Type: Bug Something isn't working

Comments

@hedgerh
Copy link

hedgerh commented Sep 14, 2018

I am trying to embed a reach menu-button inside of a reach dialog. This doesn't seem to work, though. The MenuList never appears.

Interestingly enough, I added a debugger to the Portal code, and when I clicked the play button inside of Chrome dev tools (not the one that appears over the window) to play through the execution, the MenuList appears!

https://codesandbox.io/s/j7lvkzwyz3

Is this a bug?

@joaogarin
Copy link

Could it be trying to open two portals and somehow not allowing? it looks like the attribute aria-expanded is triggered twice though..or just being set to "false", but it is being updated..

@ryanflorence
Copy link
Member

ryanflorence commented Jan 4, 2019

Weird, yeah this is a bug.

Initially I don't know why this would happen, I don't even see the second portal opening in the dev tools as I interact with it.

If anybody feels like digging in to figure out why this might be happening I'd love to get your help.

Don't need a fix even, just figure out what the problem is.

@ryanflorence ryanflorence added Type: Bug Something isn't working Help Wanted Extra attention is needed labels Jan 4, 2019
@theKashey
Copy link
Contributor

  1. You open Dialog
  2. It set up focus trap
  3. You open Menu (you really did it)
  4. It moves focus to a first element
  5. Focus Trap returns focus back to Dialog
  6. Menu handles onBlur and close itself.
  7. It's closed.

3-7 are almost instant, the only way to catch it - set up breakpoint on reach-portal subtree modification.

As I said before - react-focus-lock probably would handle it out of the box

@hedgerh
Copy link
Author

hedgerh commented Jan 13, 2019

#83 seems to be where this is being discussed, so closing this.

@hedgerh hedgerh closed this as completed Jan 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help Wanted Extra attention is needed Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants