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.
react-input-placeholder
Advanced tools
Input and Textarea React components with polyfilled placeholder support.
PlaceholderShim
provides Input
and Textarea
, small wrappers around React.createElement('input')
and React.createElement('textarea')
respectively that shims in placeholder
functionality for browsers that don't natively support it. Currently only tested with IE9.
Demo: https://jsfiddle.net/69z2wepo/16498/
Install: npm install react-input-placeholder
Require:
Input = require('react-input-placeholder')(React).Input;
Textarea = require('react-input-placeholder')(React).Textarea;
The compiled bundle sits in the dist/
folder.
<script src='dist/react-input-placeholder.min.js'></script>
<script>
var Input = PlaceholderShim.Input;
var Textarea = PlaceholderShim.Textarea;
</script>
You can use Input
or Textarea
exactly the same way you'd use React.createElement('input')
or <input />
in JSX. All attributes will be passed on, and all event callbacks will be called. However, please note that the placeholder shim only works on controlled inputs (i.e., you must provide a value
or valueLink
prop).
When the placeholder text is visible, the placeholder
CSS class will be added to the input
element so you can style it, e.g.
input.placeholder,
textarea.placeholder {
color: gray;
font-style: italic;
}
Placeholder doesn't show on IE9.
<input placeholder="Enter text here..." value={this.state.value} onChange={this.handleChange} />
Works on IE9!
<Input placeholder="Enter text here..." value={this.state.value} onChange={this.handleChange} />
npm install
grunt dist
MIT
1.2.0
If you are not using JSX, you will need to wrap the use of this module in createFactory
.
FAQs
Input and Textarea React components with polyfilled placeholder support.
The npm package react-input-placeholder receives a total of 316 weekly downloads. As such, react-input-placeholder popularity was classified as not popular.
We found that react-input-placeholder demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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.