-
Notifications
You must be signed in to change notification settings - Fork 119
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
<textarea> and <pre> are not aligned when a width is set #34
Comments
I've noticed this too. Can anyone recommend short term fix? Any kind of workaround would do for my purposes. |
@d4hines These properties seem to quick-fix the issue: .CodeFlask__textarea {
white-space: nowrap;
overflow-x: hidden;
} While this CSS helps, the real solution will be implementing horizontal scrolling support for CodeFlask. As of today, it only support vertical scrolling it seems. |
Thanks for the response! I tried implementing the above CSS, but didn't notice any difference in the issue. |
@d4hines That must be overriding by another rule. Adding .CodeFlask .CodeFlask__textarea {
white-space: nowrap;
overflow-x: hidden;
} |
Hi Kazzkiq, |
@d4hines It seems to be a issue with the CSS. The selector is applying same properties to both The main issue seems to be with So basically a quick-fix should be adding this to your CSS in order to override the property from CodeFlask: .CodeFlask .CodeFlask__code {
position: relative;
} I will take a closer look to this bug this weekend, until there you can probably run smoothly with the CSS code above. |
@kazzkiq: Your fix works but after that |
This was fixed in 1.0. Lots of changes though, since its a major version upgrade. |
Having some is issues moving from early version to new. I have a prism language definition (sql) included as a js, (eg Prism.languages.sql={comment: etc) |
@scaddenp You now have to add new languages by using const sqlflask = new CodeFlask('#codeFlaskSQL', {language: "sql"});
sqlflask.addLanguage('sql', {comment: etc...}); |
thanks. That works for highlighting. Now to sort out the css miasma... |
Got the css sorted, except that no text cursor in box no matter what I do. is there an example project using codeflask that could be used for reference? |
@scaddenp You can take a look at the project website, or take a look at this example here: |
Yes, thanks very much for that. What I notice is that editor.js has the codeflask-style that I see on the fiddle. However, the .codeflask-style that is injected when using codeflask.min.js is different. ie |
@scaddenp You're right. There was an error with the release on npm. It is now fixed and the version |
Thanks very much for your persistence. With new code and one more fiddle to css (background was same colour as text caret), I now have the caret and everything looking nice. I salute your efforts to make life easier for the rest of us. |
Testcase: http://codepen.io/fcicileo/pen/LWrGwE
It appears that when the container has a specific width set via CSS, the code in the
<textarea>
and the<pre>
is not aligned anymore.The text was updated successfully, but these errors were encountered: