Skip to content
Extraits de code Groupes Projets
Valider a6079a42 rédigé par ThibG's avatar ThibG Validation de Eugen Rochko
Parcourir les fichiers

Fix composer not getting focus after reply confirmation dialog (#9602)

The modal-handling code gives back focus to the element focused when the
modal opened. However, in the case of reply confirmation, it would do so
*after* the composer code itself requested focus.
parent de3cecf3
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -33,13 +33,15 @@ export default class ModalRoot extends React.PureComponent { ...@@ -33,13 +33,15 @@ export default class ModalRoot extends React.PureComponent {
} else if (!nextProps.children) { } else if (!nextProps.children) {
this.setState({ revealed: false }); this.setState({ revealed: false });
} }
if (!nextProps.children && !!this.props.children) {
this.activeElement.focus();
this.activeElement = null;
}
} }
componentDidUpdate (prevProps) { componentDidUpdate (prevProps) {
if (!this.props.children && !!prevProps.children) { if (!this.props.children && !!prevProps.children) {
this.getSiblings().forEach(sibling => sibling.removeAttribute('inert')); this.getSiblings().forEach(sibling => sibling.removeAttribute('inert'));
this.activeElement.focus();
this.activeElement = null;
} }
if (this.props.children) { if (this.props.children) {
requestAnimationFrame(() => { requestAnimationFrame(() => {
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter