-
-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The line number display issue in the light box #5876
Comments
@Berni69 I have fixed on my codes via adding the "setTimeout" to delay the codemirror load. I guess that because the codemirror calculate the html element size before they are visible. Once the html rendered, then initialize the codemirror, it will looks good.
|
I have a similar issue with codemirror: When the codemirror is inside an accordion and if lineNumbers is set to true then the data entered overlaps with the line numbers. Also if theres any data that is already available then it doesn't appear at first, it only appears when I click inside the codemirror and again, it overlaps with the line numbers. |
Because of the accordion content panel don't have the height value when dom ready, the codemirror should know the container height and width to calculate the dom layout. If we want to fix this issue, we should use setTimeout to delay init the codeMirror and make sure the container dom element have the fixed width and height. That's my idea. FYI. |
I have same problem in modal and specific tab ....
|
I have similar issue, I attach two proof-of-concepts, based on the trailingspace.html trailingspace_booster_tab.html.zip in this first example I added Bootstrap and two tabs, each with the same content (up to changing In the second example trailingspace_booster_tab_2.html.zip similarly to what Farshadi73 did , it triggers the CodeMirro code when the second tab is shown; the defect is that , each time you switch tab, a new editor pane is created; but as you see from the console , the code is run only once, so it is unclear where this behaviour is coming from. EDITING there was a mistake in the second example. Now it works fine. trailingspace_booster_tab_2.html.zip The important point is to make sure that the CodeMirror code is called only once, as follows
To view the examples, unpack in the demo subdir. Regards. a. |
Describe the bug
![image](https://user-images.githubusercontent.com/40879710/57576912-49017d80-749e-11e9-8485-5b2f4118a6d9.png)
![image](https://user-images.githubusercontent.com/40879710/57576959-fecccc00-749e-11e9-8011-1f5966ea0419.png)
![image](https://user-images.githubusercontent.com/40879710/57577009-1e182900-74a0-11e9-9c60-aac0cc631264.png)
If the codemirror in a lightbox, when the lightbox show, the codemirror linenumber display not correct:
But when I scroll the scrollbar, the line number will display well:
If I focus on it, then type the "Enter" key, the new line number will display well, the original still has the display issue:
I have set the "autoRefresh" property and reference the "autoRefresh" plugin:
Another issue is the text area connot get the codemirror value, I have to get the value via handle the "change" event to archived it.
And if I want to select some codes vai the mouse in the code mirror, the display UI not make sense and the select behavor not comfortable.
![image](https://user-images.githubusercontent.com/40879710/57577069-63892600-74a1-11e9-9366-adf78c33b58e.png)
I try to use the "refresh()" to fix it, but still failed:
![image](https://user-images.githubusercontent.com/40879710/57577090-f629c500-74a1-11e9-9d07-a5d6501b883e.png)
The first two columns will not display well.
editor.refresh();
BTW, if the codemirror in a normal page, it works fine.
Expected behavior
Screenshots
Above all screenshots.
Desktop (please complete the following information):
Additional context
Codemirror Version: 5.42.2
Thanks so much, the codemirror is a so amazing editor!
The text was updated successfully, but these errors were encountered: