Skip to content
This repository has been archived by the owner on Sep 1, 2020. It is now read-only.

keyboard event listener not unregistered #176

Closed
loicbourg opened this issue Dec 8, 2017 · 5 comments
Closed

keyboard event listener not unregistered #176

loicbourg opened this issue Dec 8, 2017 · 5 comments

Comments

@loicbourg
Copy link
Contributor

Version

1.9.1

Test Case

https://jsfiddle.net/6ty1r8yn/1/

Steps to reproduce

  • Right click on the context menu trigger.
  • Hover the first Sub menu
  • Click "Ajouter"
  • Type some text in the textarea and try to add a new line with enter

Expected Behavior

I should have a text with multiple new line in the textarea

Actual Behavior

no new line is added

Additional informations

The arrow key are also not working.

I suspect it comes from https:/vkbansal/react-contextmenu/blob/master/src/AbstractMenu.js#L21

in the console there is a warning when using the arrow key or enter:
Warning: Can only update a mounted or mounting component. This usually means you called setState, replaceState, or forceUpdate on an unmounted component. This is a no-op.

Please check the code for the t component.

@loicbourg
Copy link
Contributor Author

Any idea about the origin of the bug ?

@vkbansal
Copy link
Owner

I've published [email protected] with possible fix. Can you try it?

@loicbourg
Copy link
Contributor Author

loicbourg commented Dec 19, 2017

@vkbansal thanks for the release !
That's working better now but there is still a problem on the first press on the Enter key, but the next press ont the key are working.

example here: https://jsfiddle.net/6ty1r8yn/1/

@vkbansal vkbansal added the bug label Dec 19, 2017
@vkbansal
Copy link
Owner

This issue is caused by https:/vkbansal/react-contextmenu/blob/master/src/SubMenu.js#L215

This will need a deep dive and may take some time

@stale
Copy link

stale bot commented Feb 17, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Feb 17, 2018
@stale stale bot closed this as completed Feb 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants