Comments (4)
I just gonna add my Issue here, since I seem to be struggling with something similar.
TypeError: document.body.createTextRange is not a function
at range (node_modules/codemirror/lib/codemirror.js:94:25)
at hasBadBidiRects (node_modules/codemirror/lib/codemirror.js:1244:12)
at buildLineContent (node_modules/codemirror/lib/codemirror.js:1825:9)
at updateExternalMeasurement (node_modules/codemirror/lib/codemirror.js:2429:28)
at prepareMeasureForLine (node_modules/codemirror/lib/codemirror.js:2465:14)
at measureChar (node_modules/codemirror/lib/codemirror.js:2438:34)
at endOperation_R2 (node_modules/codemirror/lib/codemirror.js:3788:24)
at endOperations (node_modules/codemirror/lib/codemirror.js:3754:7)
at node_modules/codemirror/lib/codemirror.js:3741:5
at finishOperation (node_modules/codemirror/lib/codemirror.js:2119:5)
at endOperation (node_modules/codemirror/lib/codemirror.js:3738:3)
at new CodeMirror$1 (node_modules/codemirror/lib/codemirror.js:7824:3)
at CodeMirror$1 (node_modules/codemirror/lib/codemirror.js:7765:49)
at Controlled.Object.<anonymous>.Controlled.componentDidMount (node_modules/react-codemirror2/index.js:264:23)
I'm just running the basic renders without crashing
test, starting & using the app works just fine.
@scniro did you have any success solving this issue?
I'll let you guys know if i find something in the meantime!
EDIT:
Turned out it was an issue with JSDOM and not codemirror, my bad.
I found a solution for my issue here
from react-codemirror2.
Just stopping by and not sure if you've figured out your problems or not. I noticed that you were using Enzyme.shallow
which does not run the react component lifecycle. I think you'll need to perform a full mount in case you need to run lifecycle methods.
from react-codemirror2.
@KevinGrandon Hey thanks for checking in on this. I've been working on a 4.x release for a bit that'll be coming up soon and I've managed to get around ~85% coverage which is definitely heading in the right direction. I have been using .mount
where it makes sense, but there is still the struggle of dealing with then-later-rendered DOM escaping the enzyme API. I've found a few creative ways to get around it, but it's still less than ideal. I'll chalk it up as a just-deal-with-it because testing a third-party component that's simply shipped in a react component wrapper is not an ideal situation anyways. Thank you for your interest on this!
from react-codemirror2.
@PatrM @KevinGrandon 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.
from react-codemirror2.
Related Issues (20)
- Collaborative Editing Support
- Editor Duplicating HOT 3
- It is possible use the lint funcionality with codemirror2?
- Is there any guide for integrating react-codemirror2 into NextJs? HOT 2
- Is is possbile to trigger the re run of a mode?
- react-codemirror2 value not showing HOT 1
- Defining the onChange type independently
- Any help with this error "cm is not a function" in nextJs HOT 4
- Why two input boxes are generated? HOT 1
- Codemirror support for react v18? HOT 17
- Getting "cm is not a function" in NextJs HOT 4
- could anybody tell me how to install codemirror2 on react18.2.0 HOT 3
- how to parse value to js variant ?
- Accessibility improvement for <textarea> form control element HOT 2
- sql mode can not fold
- quickly location
- After the string is too long, it loses formatting highlighting HOT 1
- cm is not a funciton HOT 2
- controlling linting from a button click
- Cursor issues with React 18 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-codemirror2.