Skip to content

yiyeop/ctrl_cmd_save

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

ctrl_cmd_save

ctrl(Windows) or Cmd(Mac) + s 이벤트

   useEffect(() => {
    const saveEvent = e => {
      if ((window.navigator.platform.match('Mac') ? e.metaKey : e.ctrlKey) && e.keyCode === 83) {
        e.preventDefault();
        // onSubmit();
      }
    };
    document.addEventListener('keydown', saveEvent, false);
    return () => {
      document.removeEventListener('keydown', saveEvent);
    };
  }, [data, onSubmit]);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published