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

Fix kb types #145

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Fix kb types #145

wants to merge 3 commits into from

Conversation

andyrichardson
Copy link

@andyrichardson andyrichardson commented Jun 24, 2019

Fix #144

Events have been determined by referring to the MDN docs.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 81.174% when pulling 009154b on andyrichardson:fix-kb-types into a633e7d on scniro:master.

@zant
Copy link

zant commented Sep 10, 2019

Hey! Not related to the repo but i'm using plain CodeMirror inside a TS/React project and i'm trying to attach a function to the on('keydown') method:

codeMirror.on("keydown", handleKeyDown);

But i'm getting this:

Type 'Event' is missing the following properties from type 'KeyboardEvent': altKey, char, charCode, code, and 16 more.

I used the same interface as you in my handler:

const handleKeyDown: DomEvent<KeyboardEvent> = (instance, event) => {...}

Def:

interface DomEvent<T extends Event = Event> {
  (editor: CodeMirror.Editor, event: T): void;
}

This PR was enough for you to fix it? Some ideas on why it's not working for me are going to be highly appreciated 🙏

@andyrichardson
Copy link
Author

@gonzarodriguezt this was the same issue I had. This PR fixes it.

@scniro
Copy link
Owner

scniro commented Jan 19, 2020

@andyrichardson @grdnrt I am a lot shorter on time these days as when I started this project. Codemirror & React APIs are moving to quickly for me to keep atop of for the day-to-day. I am looking for a co-maintainer of this project. Please contact me directly if you are interested. Thank you for understanding.

@elsigh
Copy link
Collaborator

elsigh commented May 19, 2020

@andyrichardson do you mind doing a pull from master to resolve conflicts? Then I'll merge this!

@andyrichardson
Copy link
Author

For sure, I'll take a quick look some time today

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

Successfully merging this pull request may close these issues.

Incorrect typing for KeyEvents
5 participants