Skip to content
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

wrap="off" + autosize prevents editing long lines #24

Closed
breunigs opened this issue Sep 17, 2012 · 2 comments
Closed

wrap="off" + autosize prevents editing long lines #24

breunigs opened this issue Sep 17, 2012 · 2 comments

Comments

@breunigs
Copy link

See this js fiddle: http://jsfiddle.net/Dsb87/1/

Autosize doesn’t recognize textareas with wrap=off. Even if enabling the horizontal scrollbar explicitly in CSS it is disabled by Autosize. Instead, it adds an additional line so that the text would fit if wrapping were on.

The use case for such a textarea is where the line breaks matter (i.e. one option per line).

@jackmoore
Copy link
Owner

I'm not familiar with the wrap property. That's non-standard, isn't it? I doubt I'll add support for that, but wouldn't the CSS property for white-space do the same thing? How about this:

http://jsfiddle.net/kqPDg/

The !important modifier is to add a higher specificity than the overflow style that autosize sets in the CSS.

@breunigs
Copy link
Author

Yes, it’s non-standard. However it’s the only way Gecko will not wrap the contents – for some reason it ignores the CSS nowrap for textareas (it doesn’t work in your fiddle, for example).

However, wrap=off + css nowrap + !important for overflow-x seem to work in all browsers. I thus mark this ticked closed. Thanks for your help.

henrixapp pushed a commit to FachschaftMathPhysInfo/seee that referenced this issue Apr 11, 2018
Note that this is currently broken for long lines, see:
jackmoore/autosize#24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants