Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
šŸ› Fixed scheduled date/time inputs not being focusable when used fromā€¦
Browse files Browse the repository at this point in the history
ā€¦ post preview modal

closes TryGhost/Ghost#14296

- bumped fork of `ember-promise-modals` as newer version exposes all focus-trap options and per-modal disabling
- disabled focus-trap for the post preview modal because it was preventing clicks on the input elements performing default behaviour
  • Loading branch information
kevinansfield committed Mar 11, 2022
1 parent 51d0650 commit 4cbb56a
Show file tree
Hide file tree
Showing 4 changed files with 406 additions and 277 deletions.
3 changes: 2 additions & 1 deletion app/controllers/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,8 @@ export default class EditorController extends Controller {
setEditorSaveType: this.actions.setSaveType.bind(this),
memberCount: this.memberCount
}, {
className: 'fullscreen-modal fullscreen-modal-full-overlay fullscreen-modal-email-preview'
className: 'fullscreen-modal fullscreen-modal-full-overlay fullscreen-modal-email-preview',
focusTrapOptions: null // not ideal but date inputs aren't focusable otherwise
});
}

Expand Down
8 changes: 5 additions & 3 deletions app/services/modals.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ export default class ModalsService extends EPMModalsService {
// we manually close modals on backdrop clicks and escape rather than letting focus-trap
// handle it so we can intercept/abort closing for things like unsaved change confirmations
allowOutsideClick = true;
clickOutsideDeactivates = false;
escapeDeactivates = false;
focusTrapOptions = {
allowOutsideClick: true,
clickOutsideDeactivates: false,
escapeDeactivates: false
};
open(modal, data, options) {
const mergedOptions = Object.assign({}, this.DEFAULT_OPTIONS, this.MODAL_OPTIONS[modal], options);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
"ember-power-calendar-moment": "0.1.7",
"ember-power-datepicker": "cibernox/ember-power-datepicker",
"ember-power-select": "4.1.5",
"ember-promise-modals": "TryGhost/ember-promise-modals#v2.0.0+ghost.3",
"ember-promise-modals": "TryGhost/ember-promise-modals#v2.0.0+ghost.4",
"ember-resolver": "8.0.3",
"ember-route-action-helper": "2.0.8",
"ember-simple-auth": "4.2.0",
Expand Down

0 comments on commit 4cbb56a

Please sign in to comment.