kaivi / reactinlineedit Goto Github PK
View Code? Open in Web Editor NEWSimple React component for in-place text editing and validation
License: MIT License
Simple React component for in-place text editing and validation
License: MIT License
I'd like to make a feature request -- when the validation fails, there should be an option to supply a callback to handle that failure and update the UI appropriately. I don't think this would be too complicated to add.
Thoughts??
If the library gives a callback for validation failures, it will be helpful to give feedback to user.
When I use number in the props 'text' of the InlineEdit component, I have this error "Invalid prop text
of type number
supplied to InlineEdit
, expected string
". Is it possible to allow number type ? Thx !
Support for React 16. Proptype is deprecated I think we need to add prop-types library instead
More of a feature request than anything, and I am currently working on it, but I would like the ability to specify a custom element using the "editingElement" prop. I can create a pull request for this once my fork is working. Just wanted to give @kaivi a heads up and if this functionality is already possible, please let me know
I'd like to have the browser automatically focus on the InlineEdit field to make it more obvious to the user that the field is editable.
Using React's built-in autoFocus param does not work:
<InlineEdit autoFocus text="Untitled Project" paramName="title" change={editTitle} />
.
For now I'm using a compromise by finding the specific DOMNode on componentDidMount:
componentDidMount() {
ReactDOM.findDOMNode(this.refs.title).focus();
}
render() {
const {editTitle} = this.props;
return (
<InlineEdit ref="title" text="Untitled Project" paramName="title" change={editTitle} />
)
}
While the workaround isn't necessarily difficult to implement, I'd prefer the InlineEdit component be compatible with autoFocus
. No worries if this is too difficult to implement, huge fan of this library otherwise!
I was wondering, why did you take that approach? Passing an object with key paramName
and value state.text
to the change
function? https://github.com/kaivi/ReactInlineEdit/blob/master/index.jsx#L43-L48
As opposed to just doing this.props.change(this.state.text)
?
Currenty the non-editing element is a span
. It would be nice if we could specify the element to use. For example, use a p
or a div
for the non-editing element.
What sort of permission do we have to use this? Any licenses?
I could see benefits of this being set either way, depending on the application. Would be great to have a boolean flag like "updateOnBlur".
Hi,
am getting error, when i try to edit,
Warning: Unknown prop onReturn
on tag. Remove this prop from the element.
Would like to disable spellcheck as shown below:
As this post shows, there is no way to turn off spellcheck via CSS. Is there a way to pass down props directly to the input
element?
Hey!
Seeking for inline edit with more capabilities, I found what I need in your new project,
Any chance to expose its current early stage ? (End of feb is too late and i'm the other alternatives are not nice as yours!)
Thanks! =)
Hi,
Is it possible to programmatically enter edit mode?
That is, I don't want a click to enter edit mode, rather I want the click to propagate to the parent, and not be handled by the <InlineEdit>
component. And The parent component will decide when to go into edit mode.
If not, I think it will make a good addition.
For example when the label is on a button, and clicking the button does something, but pressing Shift+click will go into edit mode.
Thanks,
Erez
Inline editing via a textarea and would have enter/return add a new line vs change editing state. Is there way to do that?
With React 15.5, importing PropTypes from React is deprecated in favour of importing from the new 'prop-types' package.
https://facebook.github.io/react/blog/2017/04/07/react-v15.5.0.html
Can ReactInlineEdit be updated?
its waiting values as a string format
other hand, i i want to set editingElement input[type="date"], console get error
Uncaught Error: Invalid tag: input[type="date"]
Is there any way to set the InlineEdit to disabled
so that the user may no longer edit the field?
Because createElement
accepts both string
and function
, the propType for staticElement
can be both.
I would like to add feature to control active/deactive edit mode. So that, parent element would be able to active/deactive edit mode on some events.
Assigning these values doesn't have impact on the output input...
My code looks like this:
<InlineEdit className="great-class-name"
text={someDefaultValue}
activeClassName="some-input"
paramName={'value'}
minLength={1}
maxLength={5}
validate={this._someFunc.bind(this)}
change={this._someFunc.bind(this)} />
When I put a blank string into text, I am unable to click on the span tag to be able to edit the field
Error: index.js:293 Uncaught SyntaxError: Unexpected token <<
System: Linux Mint
Browser: last Google Chrome
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.