Skip to content

Commit

Permalink
A11y: Explicit <form> element around compose area (mastodon#19742)
Browse files Browse the repository at this point in the history
  • Loading branch information
sunny authored Nov 4, 2022
1 parent c217099 commit 0165449
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 2 additions & 0 deletions app/javascript/mastodon/components/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export default class Button extends React.PureComponent {

static propTypes = {
text: PropTypes.node,
type: PropTypes.string,
onClick: PropTypes.func,
disabled: PropTypes.bool,
block: PropTypes.bool,
Expand Down Expand Up @@ -42,6 +43,7 @@ export default class Button extends React.PureComponent {
onClick={this.handleClick}
ref={this.setRef}
title={this.props.title}
type={this.props.type}
>
{this.props.text || this.props.children}
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ class ComposeForm extends ImmutablePureComponent {
}

return (
<div className='compose-form'>
<form className='compose-form'>
<WarningContainer />

<ReplyIndicatorContainer />
Expand Down Expand Up @@ -279,10 +279,16 @@ class ComposeForm extends ImmutablePureComponent {

<div className='compose-form__publish'>
<div className='compose-form__publish-button-wrapper'>
<Button text={publishText} onClick={this.handleSubmit} disabled={!this.canSubmit()} block />
<Button
type="submit"
text={publishText}
onClick={this.handleSubmit}
disabled={!this.canSubmit()}
block
/>
</div>
</div>
</div>
</form>
);
}

Expand Down

0 comments on commit 0165449

Please sign in to comment.