Skip to content

Commit 16cd388

Browse files
author
Anand Sainath
committed
Adding the event parameter to most of the callbacks that use the event argument. #88
1 parent 1f53c83 commit 16cd388

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
5.0.3
2+
==================
3+
* #88
4+
5+
5.0.2
6+
==================
7+
8+
19
5.0.1
210
==================
311
* #78

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-codemirror2",
3-
"version": "5.0.2",
3+
"version": "5.0.3",
44
"description": "a tiny react codemirror component wrapper",
55
"main": "index.js",
66
"typings": "index.d.ts",

src/index.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ class Shared implements ICommon {
227227
break;
228228
}
229229
case 'onCursor': {
230-
this.editor.on('cursorActivity', (cm) => {
230+
this.editor.on('cursorActivity', (cm, event) => {
231231
this.props.onCursor(this.editor, this.editor.getCursor());
232232
});
233233
}
@@ -239,13 +239,13 @@ class Shared implements ICommon {
239239
}
240240
break;
241241
case 'onCut': {
242-
this.editor.on('cut', (cm) => {
242+
this.editor.on('cut', (cm, event) => {
243243
this.props.onCut(this.editor, event);
244244
});
245245
break;
246246
}
247247
case 'onDblClick': {
248-
this.editor.on('dblclick', (cm) => {
248+
this.editor.on('dblclick', (cm, event) => {
249249
this.props.onDblClick(this.editor, event);
250250
});
251251
break;
@@ -257,7 +257,7 @@ class Shared implements ICommon {
257257
}
258258
break;
259259
case 'onDragLeave': {
260-
this.editor.on('dragleave', (cm) => {
260+
this.editor.on('dragleave', (cm, event) => {
261261
this.props.onDragLeave(this.editor, event);
262262
});
263263
break;
@@ -269,7 +269,7 @@ class Shared implements ICommon {
269269
}
270270
break;
271271
case 'onDragStart': {
272-
this.editor.on('dragstart', (cm) => {
272+
this.editor.on('dragstart', (cm, event) => {
273273
this.props.onDragStart(this.editor, event);
274274
});
275275
break;
@@ -311,13 +311,13 @@ class Shared implements ICommon {
311311
}
312312
break;
313313
case 'onMouseDown': {
314-
this.editor.on('mousedown', (cm) => {
314+
this.editor.on('mousedown', (cm, event) => {
315315
this.props.onMouseDown(this.editor, event);
316316
});
317317
break;
318318
}
319319
case 'onPaste': {
320-
this.editor.on('paste', (cm) => {
320+
this.editor.on('paste', (cm, event) => {
321321
this.props.onPaste(this.editor, event);
322322
});
323323
break;
@@ -335,7 +335,7 @@ class Shared implements ICommon {
335335
}
336336
break;
337337
case 'onTouchStart': {
338-
this.editor.on('touchstart', (cm) => {
338+
this.editor.on('touchstart', (cm, event) => {
339339
this.props.onTouchStart(this.editor, event);
340340
});
341341
break;

0 commit comments

Comments
 (0)