question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

when use code mirror in a tabs Put code mirror control in second tab Initialize some data the code mirror control will be display a blank, until the mouse click (image 1) when click code mirror,will be display the content ,but line number display an error (image 2) The following is the demo code:

            <ul>
        <li onclick="SelectTab(0)">Tab 1</li>
        <li onclick="SelectTab(1)">Tab 2</li>
    </ul>
    <div class="tab-content" id="tab-content-1">
        This is a tab content 1
    </div>
    <div class="tab-content" id="tab-content-2" style="display:none">
        <textarea code-style type="text" id="txtEditor" ng-model="Html"></textarea>
    </div>
<script type="text/javascript"> var SelectTab=function(index){ if (index===0){ $("#tab-content-1").show(); $("#tab-content-2").hide(); }else{ $("#tab-content-2").show(); $("#tab-content-1").hide(); } } $(function(){ var myCodeMirror = CodeMirror.fromTextArea(document.getElementById("txtEditor"), { mode:"javascript", lineNumbers: true, theme:"mbo" , value:"var data = new datetime();" }); }); </script>

before click: bug1

after click: image

please check it ! Any question please let me know! thanks

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jianlecommented, Mar 17, 2017

@tiny-v Something worked for me:

    var editor = document.getElementById('editor');
    myCodeMirror = CodeMirror.fromTextArea(editor, {
      mode: "text/x-hive",
      lineNumbers: true,
      lineWrapping: true,
      theme: 'monokai'
    });
    myCodeMirror.setSize('100%', '100%');
    myCodeMirror.setValue(sqls);
    var show = setInterval(function() {
      myCodeMirror.refresh();
    }, 10);
    setTimeout(function() {
      clearInterval(show);
    }, 500);
0reactions
MoyuShacommented, Nov 22, 2019

@jianle myCodeMirror.setSize('100%', '100%'); this worked for me, thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bug Display - Etsy
Check out our bug display selection for the very best in unique or custom, handmade pieces from our insects shops.
Read more >
210 Bug display ideas | insect art, insects, beautiful bugs
Jun 19, 2019 - Explore Sarah Sebby's board "Bug display" on Pinterest. See more ideas about insect art, insects, beautiful bugs.
Read more >
Display | Bug Hunter
Display. There are a variety of reasons people collect, preserve and ... Alternatively, people display insects or insect parts as art and decorations....
Read more >
Is this a display issue or any bug? - OnePlus Community
I have some issues in my display when it's full brightness. I could see some dark patches in black screen. is this a...
Read more >
Troubleshoot screen flickering in Windows - Microsoft Support
To determine whether a display driver or app is causing the problem, check to see if Task Manager flickers. Then, based on that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found