fkhadra / react-contexify

👌 Add a context menu to your react app with ease

Home Page:https://fkhadra.github.io/react-contexify/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Menu is removed before item actions are completed.

Abramo-Bagnara opened this issue · comments

I need to put a <input type="file"> as a menu item, but as the file chooser dialog steal the focus, the menu is removed from DOM and then the change event from input element is not fired.

Of course closeOnClick does not help as the problem is due to focus loss.

Do we have a way to avoid that menu is removed (e.g. just hiding it)?

Not that I like the solution very much, but I've been able to make it work as expected using animation="show" and the following css:

.contexify_willEnter-show {
  display: block;
}

.contexify_willLeave-show {
  display: none;
  animation-duration: 1000s;
}