scniro / react-codemirror2

Codemirror integrated components for React
MIT License
1.65k stars 192 forks source link

Add a line widget onGutterClick #267

Open Muhammad-Tahir-S opened 2 years ago

Muhammad-Tahir-S commented 2 years ago

I’m trying to create an input widget for everytime a line number in the gutter is clicked. Presently, I’m able to pass the function addInputLineWidget onCursor change, and so every time the cursor on the editor switches to a new line, it fires the addInputLineWidget function. However that will be too inconvenient for users. And so I want the addInputLineWidget function to run only when the line numbers in the gutter are clicked, so that it pops up the input widget on the corresponding line as was clicked.

When i pass addInputLineWidget onGutterClick, I receive this error: image

function addInputLineWidget: image

Codemirror Editor Wrapper: image

Codemirror Component: image

react-codemirror version: 7.1.0, Browser version: Google Chrome Version 94.0.4606.8 Operating system: macOS Big Sur v 11.5.2

Any help would be much appreciated.