scniro / react-codemirror2

Codemirror integrated components for React
MIT License
1.66k stars 193 forks source link

[bug] didn't display cursor and line numbers when focus #141

Open bytemain opened 5 years ago

bytemain commented 5 years ago

I use a button to control the display of codemirror, and when I click the button, the codemirror would be focus. so I use this.CodeMirrorInstance to control the codemirror component's focus, and it successed. image but it won't render the cursor and line numbers, until I press some key or click the input area. image

gif: 1

zohaibijaznbs commented 5 years ago

Facing the same issue

scniro commented 5 years ago

@lengthmin @zohaibijaznbs hey thanks for opening this. Hm, are you manually focusing before the editor is fully rendered? Try throwing a setTimeout => then focus, just to see if we can further identify what's going on

bytemain commented 5 years ago

test failed. it just won't show the line number and cursor, and it is focused.

scniro commented 4 years ago

@lengthmin @zohaibijaznbs 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.