Fix reply button on media modal not giving focus to compose form (#17626)
* Avoid compose form and modal management fighting for focus * Fix reply button on media modal footer not giving focus to compose form
This commit is contained in:
parent
d4592bbfcd
commit
2cd31b3177
7 changed files with 50 additions and 19 deletions
|
@ -3,22 +3,23 @@ import { openModal, closeModal } from '../../../actions/modal';
|
|||
import ModalRoot from '../components/modal_root';
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
type: state.getIn(['modal', 0, 'modalType'], null),
|
||||
props: state.getIn(['modal', 0, 'modalProps'], {}),
|
||||
ignoreFocus: state.getIn(['modal', 'ignoreFocus']),
|
||||
type: state.getIn(['modal', 'stack', 0, 'modalType'], null),
|
||||
props: state.getIn(['modal', 'stack', 0, 'modalProps'], {}),
|
||||
});
|
||||
|
||||
const mapDispatchToProps = dispatch => ({
|
||||
onClose (confirmationMessage) {
|
||||
onClose (confirmationMessage, ignoreFocus = false) {
|
||||
if (confirmationMessage) {
|
||||
dispatch(
|
||||
openModal('CONFIRM', {
|
||||
message: confirmationMessage.message,
|
||||
confirm: confirmationMessage.confirm,
|
||||
onConfirm: () => dispatch(closeModal()),
|
||||
onConfirm: () => dispatch(closeModal(undefined, { ignoreFocus })),
|
||||
}),
|
||||
);
|
||||
} else {
|
||||
dispatch(closeModal());
|
||||
dispatch(closeModal(undefined, { ignoreFocus }));
|
||||
}
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue