draft.js remove ariaDescribedBy from Editor component

时间:2019-02-18 00:22:27

标签: reactjs draftjs

using Draft.js on a project

I would like to use ariaDescribedBy but only when there's an error, but it always displays, even when commented out, set to false, null ect

my code looks something like this

import {
  Editor,
  EditorState,
  RichUtils,
  DefaultDraftBlockRenderMap
} from 'draft-js';

....

         <Editor
              id={id}
              // ariaDescribedBy={`${id}-error`} // should display only on error but always displays, even when commented out?
              blockRenderMap={blockRenderMap}
              editorState={editorState}
              handleKeyCommand={this.handleKeyCommand}
              onChange={this.handleChange}
              onBlur={this.handleBlur}
              ref={c => {
                this.editor = c;
              }}
              placeholder={placeholder}
              spellCheck
            />

but still renders the aria-describedby attribute

this is not the behaviour i want

any ideas on how to get rid of it

0 个答案:

没有答案