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

onMouseDown doesn't have the event parameter passed in correctly #88

Closed
anandsainath opened this issue May 24, 2018 · 3 comments · Fixed by #89
Closed

onMouseDown doesn't have the event parameter passed in correctly #88

anandsainath opened this issue May 24, 2018 · 3 comments · Fixed by #89
Labels

Comments

@anandsainath
Copy link
Contributor

This is the current onMouseDown event that is bound.

case 'onMouseDown':
{
  _this.editor.on('mousedown', function(cm) {
    _this.props.onMouseDown(_this.editor, event);
  });
  break;
}

The callback function doesn't have an event variable that is passed in - which causes ReferenceError: event is not defined in some browsers like Firefox.

@scniro
Copy link
Owner

scniro commented May 24, 2018

@anandsainath nice find. Yea now that I'm looking, there's a few which don't explicitly pass the event as well. Will try my best to get a fix in for this soon.

@scniro scniro added the bug label May 24, 2018
anandsainath pushed a commit to anandsainath/react-codemirror2 that referenced this issue May 24, 2018
@anandsainath
Copy link
Contributor Author

@scniro I just created a pull request for the same. Can you take a look and check if its good?

anandsainath added a commit to anandsainath/react-codemirror2 that referenced this issue May 25, 2018
scniro added a commit that referenced this issue May 26, 2018
Passing the event argument to callbacks that use it. #88
@scniro
Copy link
Owner

scniro commented May 26, 2018

@anandsainath Fixed with 5.0.3. Thanks for the PR!

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

Successfully merging a pull request may close this issue.

2 participants