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

extraKeys can not add 'Enter' key #183

Closed
kongchenglc opened this issue Dec 17, 2021 · 4 comments
Closed

extraKeys can not add 'Enter' key #183

kongchenglc opened this issue Dec 17, 2021 · 4 comments

Comments

@kongchenglc
Copy link

import SimpleMdeReact from 'react-simplemde-editor'

...

    <SimpleMdeReact
      value={value}
      onChange={onChange}
      options={options}
      getCodemirrorInstance={getCmInstanceCallback}
      getLineAndCursor={getLineAndCursorCallback}
      events={eventsHandlers}
      extraKeys={{
            Enter: ()=>{} // it is useless
      }}
    />
...
@coltenkrauter
Copy link

I experienced the same issue. I was able to work around it via events.

 <SimpleMDE
     events={{
         keyHandled: (editor, event) => {
             if (event == 'Enter') {
                 console.log('Enter pressed');
             }
         },
     }}
 />

@ChesterZengJian
Copy link
Contributor

ChesterZengJian commented Sep 9, 2022

I guess 'codemmirror.getoption ("extraKeys")' overrides the 'Enter' key in the extraKeys. I'm not sure that's a problem.

image

@RIP21 RIP21 closed this as completed in 3dad84a Oct 1, 2022
@RIP21
Copy link
Owner

RIP21 commented Oct 1, 2022

Almost a year passed lol.
Fixed this one in 5.1.1 already.

@coltenkrauter
Copy link

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants