export class App extends React.PureComponent<Props, State> {
mounted = false;
+ bulkButtonRef: React.RefObject<HTMLButtonElement>;
constructor(props: Props) {
super(props);
const query = parseQuery(props.location.query);
+ this.bulkButtonRef = React.createRef();
this.state = {
bulkChangeModal: false,
checked: [],
};
handleCloseBulkChange = () => {
- this.setState({ bulkChangeModal: false });
+ this.setState({ bulkChangeModal: false }, () => {
+ if (this.bulkButtonRef.current) {
+ this.bulkButtonRef.current.focus();
+ }
+ });
};
handleBulkChangeDone = () => {
title={translate('issues.select_all_issues')}
/>
<Button
+ innerRef={this.bulkButtonRef}
disabled={checked.length === 0}
id="issues-bulk-change"
onClick={this.handleOpenBulkChange}>
interface ButtonProps extends AllowedButtonAttributes {
autoFocus?: boolean;
children?: React.ReactNode;
- innerRef?: (node: HTMLElement | null) => void;
+ innerRef?: React.Ref<HTMLButtonElement>;
name?: string;
onClick?: () => void;
preventDefault?: boolean;