
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
#R-Editable x-editable-like component for React.
When clicked, a span
element can turn into two editable fields.
##Input
When clicked the field will be rendered as an input
element, when unfocused or Enter
pressed, the value will be keps in the component and passed to the onChange
function.
const alertMsg = (msg)=> alert(msg)
<REditable value='Change me' onChange={alertMsg.bind(null,'You changed me!')}/>
##Dropdown
When clicked the field will be rendered as a select
element together with its received options
props. When unfocused or Enter
pressed, the value will be keps in the component and passed to the onChange
function.
const myOpt = [
{name:'Apple',value:'apple'},
{name:'Pear',value:'pear'},
{name:'Grape',value:'grape'},
{name:'Banana',value:'banana'},
{name:'Orange',value:'orange'}
]
<REditable type='dropdown' onChange={alertMsg.bind(null,'You changed dropdown')} options={myOpt} />
Note: no styling is provided by default, hence some basic CSS is suggested:
span.r-editable{
font-size: 1em;
width: auto;
border-bottom: 2px dashed red;
}
input.r-editable{
background: #C5F0DA;
font-size: 1em;
border: none;
outline: none;
width: auto;
padding:0;
margin:0;
}
select.r-editable{
font-size: 1em;
background: white;
}
div[id^='re-'] div.examples{
margin-left: 2em;
}
###License ISC
FAQs
Simple editable field for React, supporting several input types
The npm package r-editable receives a total of 2 weekly downloads. As such, r-editable popularity was classified as not popular.
We found that r-editable demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.