The issue has been closed

Workaround
Disable fit-textareas
feature.
posted by vjpr almost 5 years ago
Yes this is an issue with the way the fit-textarea
module works:
- Resets height
- Calculates minimum height
- Sets height again
This happens for every keystroke.
The alternative way textareas are generally fit to content is to
- create a copy of the textarea as a
div
- calculate its height
- update the textarea once, only when it changes.
Side note: GitHub technically has this feature already but it’s limited in height (hardcoded) and doesn’t work as well (it always leaves a 5px extra that causes the scroll bar to appear).
Does the native “fit to content” also cause this issue?
posted by fregante almost 5 years ago
If you disable fit-textareas
, you can fix most of GitHub’s native feature with just this CSS:
textarea.js-size-to-fit {
max-height: none !important; /* Increases the size limit */
box-sizing: content-box; /* Fixes unnecessary scrollbar */
width: calc(100% - 18px); /* Fixes unnecessary scrollbar */
}
However this still leaves 2 issues:
- there's still a height limit (maybe 600px?)
- once the limit is reached, the textarea completely stop resizing
Unfortunately these 2 issues make fit-textareas
still worth having in Refined GitHub, so it would be great to improve https://github.com/fregante/fit-textarea
posted by fregante almost 5 years ago
posted by fregante over 4 years ago