question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support contentEditable

See original GitHub issue
  • downshift 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:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
matt-erhartcommented, Sep 27, 2018

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

0reactions
kentcdoddscommented, Mar 21, 2018

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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found