1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-06-29 11:13:16 +02:00

fix: remove this on onKeyDownHandler

This commit is contained in:
Arnab Sen
2022-03-12 11:17:24 +05:30
parent a78a686ef1
commit 4437069580

View File

@ -31,7 +31,7 @@ const Modal = ({
useEffect(() => { useEffect(() => {
window.addEventListener('keydown', onKeyDownHandler); window.addEventListener('keydown', onKeyDownHandler);
return () => { return () => {
window.removeEventListener('keydown', this.onKeyDownHandler.bind(this)); window.removeEventListener('keydown', onKeyDownHandler.bind(this));
if (focusGrabberRef.current) { if (focusGrabberRef.current) {
focusGrabberRef.current.remove(); focusGrabberRef.current.remove();
focusGrabberRef.current = null; focusGrabberRef.current = null;