Support contentEditable
See original GitHub issuedownshift
version: 1.29.1
What you did:
I tried using Downshift using a contenteditable
div
element instead of an input
element.
What happened:
It doesn’t show the autocomplete list. (Expected, since there is getInputProps
but not something like getContentEditableProps
)
Reproduction repository: https://codesandbox.io/s/67y5xk23r
Problem description:
I’d love to use Downshift in a scenario where I need to use contenteditable
, but getInputProps
won’t work since is probably meant to be used for input elements only as the name suggests.
Suggested solution:
Add getContentEditableProps
function (or something similar) to the render function props. It would return props/event handlers specific to <div contentEditable />
so it can be used with Downshift.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
contenteditable attribute (basic support) - CanIUse
contenteditable attribute (basic support) ... Method of making any HTML element editable. Usage % of. all users, all tracked, tracked desktop, tracked mobile....
Read more >contenteditable - HTML: HyperText Markup Language | MDN
Chrome Edge
contenteditable Full support. ChromeYes. Toggle history Full suppo...
contenteditable="caret". Experimental Full support. ChromeYes. Toggle history Full suppo...
contenteditable="events". Experimental Full support. ChromeYes. Toggle history...
Read more >HTML Global contenteditable Attribute - W3Schools
The contenteditable attribute specifies whether the content of an element is ... table specify the first browser version that fully supports the attribute....
Read more >html - contenteditable browser support, does it work in ...
Yes, it's fully compatible with current browsers except Opera Mini. – imjared. Nov 6, 2013 at 16:04. Add a comment | ...
Read more >Using HTML and contenteditable to build a rich text editor
Learn about contenteditable attribute, how it is used in text editors, ... and may not be supported by all browsers (more about this, ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Here’s some code I used to learn how to combine downshift and slate (like draftjs). It’s a crappy figure stuff out script, but some might find it helpful: https://codesandbox.io/s/1qj5918w5l
Technically we already support contentEditable, the user just has to do all the work. An example integration with Draft.js would be very cool, but I don’t think we’ll build in first class support.
I’m glad you got your stuff working. Best of luck to you!