Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@moxy/grow-element-fn
Advanced tools
Update textarea height to its content with lines number customization
Update textarea height to its content with lines number customization.
Library to auto-grow and auto-shrink textarea to fit its content. Works perfect with vertical scrollbar.
word-wrap: break-word;
white-space: pre-line;
line-height: 30px; // should be defined
npm install --save grow-element-fn
Chrome | Firefox | IE | EDGE | Safari | iOS Safari | Android | Opera Mini | Windows Phone IE |
---|---|---|---|---|---|---|---|---|
yes | 57 | 10 | + | ? | ? | + | ? | ? |
import growElementFn from 'grow-element-fn';
const textarea = document.getElementById("my-textarea");
function growTextarea() {
growElementFn({
el: textarea,
minLines: 1,
maxLines: 4,
extraLine: true,
});
}
growTextarea();
textarea.addEventListener('focus', growTextarea);
textarea.addEventListener('blur', growTextarea);
textarea.addEventListener('input', growTextarea);
el (Element, required): reference to DOM element.
minLines (Number = 1): minimum lines of textarea.
maxLines (Number = 0): maximum lines of textarea to display no scrollbar. If maxLines is 0 textarea won't have maximum lines limit.
extraLine (boolean = false): add extra line in the bottom of textarea. Usefull to remove content jumping on slow devices.
FAQs
Update textarea height to its content with lines number customization
We found that @moxy/grow-element-fn demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 21 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.