about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--app/assets/javascripts/components/features/compose/components/compose_form.jsx2
-rw-r--r--app/assets/javascripts/components/features/compose/components/text_icon_button.jsx7
-rw-r--r--app/assets/javascripts/components/features/compose/containers/spoiler_button_container.jsx3
3 files changed, 7 insertions, 5 deletions
diff --git a/app/assets/javascripts/components/features/compose/components/compose_form.jsx b/app/assets/javascripts/components/features/compose/components/compose_form.jsx
index c5ff8a5bd..c148dded5 100644
--- a/app/assets/javascripts/components/features/compose/components/compose_form.jsx
+++ b/app/assets/javascripts/components/features/compose/components/compose_form.jsx
@@ -146,7 +146,7 @@ class ComposeForm extends React.PureComponent {
       <div className='compose-form'>
         <Collapsable isVisible={this.props.spoiler} fullHeight={50}>
           <div className="spoiler-input">
-            <input placeholder={intl.formatMessage(messages.spoiler_placeholder)} value={this.props.spoiler_text} onChange={this.handleChangeSpoilerText} onKeyDown={this.handleKeyDown} type="text" className="spoiler-input__input" />
+            <input placeholder={intl.formatMessage(messages.spoiler_placeholder)} value={this.props.spoiler_text} onChange={this.handleChangeSpoilerText} onKeyDown={this.handleKeyDown} type="text" className="spoiler-input__input"  id='cw-spoiler-input'/>
           </div>
         </Collapsable>
 
diff --git a/app/assets/javascripts/components/features/compose/components/text_icon_button.jsx b/app/assets/javascripts/components/features/compose/components/text_icon_button.jsx
index edf413e87..4252596c2 100644
--- a/app/assets/javascripts/components/features/compose/components/text_icon_button.jsx
+++ b/app/assets/javascripts/components/features/compose/components/text_icon_button.jsx
@@ -13,10 +13,10 @@ class TextIconButton extends React.PureComponent {
   }
 
   render () {
-    const { label, title, active } = this.props;
+    const { label, title, active, ariaControls } = this.props;
 
     return (
-      <button title={title} aria-label={title} className={`text-icon-button ${active ? 'active' : ''}`} onClick={this.handleClick}>
+      <button title={title} aria-label={title} className={`text-icon-button ${active ? 'active' : ''}`} aria-expanded={active} onClick={this.handleClick} aria-controls={ariaControls}>
         {label}
       </button>
     );
@@ -28,7 +28,8 @@ TextIconButton.propTypes = {
   label: PropTypes.string.isRequired,
   title: PropTypes.string,
   active: PropTypes.bool,
-  onClick: PropTypes.func.isRequired
+  onClick: PropTypes.func.isRequired,
+  ariaControls: PropTypes.string
 };
 
 export default TextIconButton;
diff --git a/app/assets/javascripts/components/features/compose/containers/spoiler_button_container.jsx b/app/assets/javascripts/components/features/compose/containers/spoiler_button_container.jsx
index 61ac32b85..c54904b60 100644
--- a/app/assets/javascripts/components/features/compose/containers/spoiler_button_container.jsx
+++ b/app/assets/javascripts/components/features/compose/containers/spoiler_button_container.jsx
@@ -10,7 +10,8 @@ const messages = defineMessages({
 const mapStateToProps = (state, { intl }) => ({
   label: 'CW',
   title: intl.formatMessage(messages.title),
-  active: state.getIn(['compose', 'spoiler'])
+  active: state.getIn(['compose', 'spoiler']),
+  ariaControls: 'cw-spoiler-input'
 });
 
 const mapDispatchToProps = dispatch => ({