A11y: Explicit <form> element around compose area (#19742)

lolsob-rspec
Sunny Ripert 2022-11-04 17:08:08 +01:00 committed by GitHub
parent 4b0e72b2b7
commit 5404fa8bc0
2 changed files with 11 additions and 3 deletions

View File

@ -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,
@ -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>

View File

@ -217,7 +217,7 @@ class ComposeForm extends ImmutablePureComponent {
}
return (
<div className='compose-form'>
<form className='compose-form'>
<WarningContainer />
<ReplyIndicatorContainer />
@ -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>
);
}