From 33e1167927798eac8623830d73190fc30e4f6d47 Mon Sep 17 00:00:00 2001 From: Jesse Renee Beach Date: Fri, 21 Jul 2017 17:33:58 -0700 Subject: [PATCH] Add aria-multiline attr to DraftEditor Summary: `aria-multiline` is used to indicate to assistive technology agents that a textbox is a multiline textbox. When `aria-multiline` is true, an AT should treat return key presses as carriage returns, not submit actions. https://www.w3.org/TR/wai-aria-1.1/#aria-multiline teeeeeeeested: `npm run test && npm run lint && npm run flow` Closes https://github.com/facebook/draft-js/pull/1295 Differential Revision: D5464455 fbshipit-source-id: e0033db62f4b0529875ee77fe5b0635222b16af4 --- src/component/base/DraftEditor.react.js | 1 + src/component/base/DraftEditorProps.js | 1 + 2 files changed, 2 insertions(+) diff --git a/src/component/base/DraftEditor.react.js b/src/component/base/DraftEditor.react.js index 2b821e8e52..1a84b26553 100644 --- a/src/component/base/DraftEditor.react.js +++ b/src/component/base/DraftEditor.react.js @@ -245,6 +245,7 @@ class DraftEditor extends React.Component { aria-expanded={readOnly ? null : this.props.ariaExpanded} aria-haspopup={readOnly ? null : this.props.ariaHasPopup} aria-label={this.props.ariaLabel} + aria-multiline={this.props.ariaMultiline} aria-owns={readOnly ? null : this.props.ariaOwneeID} autoCapitalize={this.props.autoCapitalize} autoComplete={this.props.autoComplete} diff --git a/src/component/base/DraftEditorProps.js b/src/component/base/DraftEditorProps.js index b7e5825c10..8fa057944a 100644 --- a/src/component/base/DraftEditorProps.js +++ b/src/component/base/DraftEditorProps.js @@ -96,6 +96,7 @@ export type DraftEditorProps = { ariaExpanded?: boolean, ariaHasPopup?: boolean, ariaLabel?: string, + ariaMultiline?: boolean, ariaOwneeID?: string, webDriverTestID?: string,