GithubHelp home page GithubHelp logo

Comments (11)

davisml avatar davisml commented on April 19, 2024 39

I ended up adding this code to my project as a temporary solution:

console.error = (function() {
    var error = console.error

    return function(exception) {
        if ((exception + '').indexOf('Warning: A component is `contentEditable`') != 0) {
            error.apply(console, arguments)
        }
    }
})()

from draft-js.

RTeran avatar RTeran commented on April 19, 2024 20

With the suppressContentEditableWarning prop you can solve this issue

from draft-js.

Drafter500 avatar Drafter500 commented on April 19, 2024 10

One more alternative is to add contentEditable attribute later on in componentDidMount() method. This produces no warning for me

  componentDidMount() {
     $(this.textedit).attr('contentEditable', true);
  }

  render() {
    const { value } = this.props;
    return (
      <div
        ref={(r) => { this.textedit = r; }}        
      >
        {value}
      </div>
    );
  }

from draft-js.

sdoomz avatar sdoomz commented on April 19, 2024 3

As an alternative you can set your console filter to regexp mode with the value: ^((?!contentEditable).)*$

from draft-js.

tasti avatar tasti commented on April 19, 2024

You aren't doing anything wrong.

This a known issue (http://facebook.github.io/draft-js/docs/advanced-topics-issues-and-pitfalls.html#react-contenteditable-warning) and it's being tracked in the react repo: facebook/react#5837

from draft-js.

hellendag avatar hellendag commented on April 19, 2024

Yep, really looking forward to eliminating this warning. :)

from draft-js.

jackcallister avatar jackcallister commented on April 19, 2024

@davisml crazy, I was just looking for a way to do this.

from draft-js.

davisml avatar davisml commented on April 19, 2024

@jarsbe I'm glad I could help! :)

from draft-js.

jackcallister avatar jackcallister commented on April 19, 2024

@davisml That's some speedy tech support, cheers!

from draft-js.

lazysergey avatar lazysergey commented on April 19, 2024

@RTeran this is real solution 👍

from draft-js.

nikhil-bacancy avatar nikhil-bacancy commented on April 19, 2024

<span id="activeLayerName" className="name" suppressContentEditableWarning={true} onClick={this.toggleLayerNameInEditMode} onBlur={this.toggleLayerNameInEditMode} contentEditable={this.state.isLayerNameEditable}> xyz </span>

from draft-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.