Weird behaviour with CodeMirror2 and jQueryUI tabs #71
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I am having a bit of an issue using CodeMirror in a jQueryUI tab component. I am using Ubuntu 10.10 and the behaviour is present in both Chrome 10.0.648.204 and Firefox 3.6.16.
To reproduce, put the code below in a local .html file, run it in a browser and do the following:
the codemirror editor appears empty
If you uncomment the two commented lines, the problem disappears, but somehow it doesn't seem like an elegant solution.
Try calling .refresh() on the CodeMirror instance after un-hiding it.
If I change the tab initialization to something like this:
it works. I could probably make that a bit more specific to the tab with the editor. But is this the best way to solve this?
Yes, this is the way to handle this. CodeMirror can't detect when it is being shown, so it needs an explicit refresh call to figure out its dimensions.
Thanks for the quick response.
mentioned in issue #2707
mentioned in issue #1
mentioned in issue #1180