Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Controllable ContentEditable #82

Closed
truescotian opened this issue Feb 22, 2018 · 3 comments
Closed

Controllable ContentEditable #82

truescotian opened this issue Feb 22, 2018 · 3 comments

Comments

@truescotian
Copy link

I'm wondering if it's possible to make a ContentEditable controllable? I'm not exactly sure of how to get the name attribute of the ContentEditable itself so I can use it as a key for setState. This may be supported, but I can't find much help on it.

Great project though! I'm simply using it as a vertical-expanding div for user input as I didn't want to use jQuery for this.

@lovasoa
Copy link
Owner

lovasoa commented Feb 24, 2018

I'm not sure I understand what you mean. You can set any property you want on the element: just set them on your ContentEditable element, and they will be forwarded to the generated element.

see:
https://github.com/lovasoa/react-contenteditable/blob/master/src/react-contenteditable.js#L12-L22

@mmathys
Copy link

mmathys commented Apr 3, 2018

@gregpmillr see #84

@truescotian
Copy link
Author

Ah thank you @mmathys. I haven't been able to come back to this but I agree with the referenced issue. I'll close this as I just had a misunderstanding of how to use the package with props. My fault.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants