I notice that I can escape a modal with exit, but it leaves the .modal-open class on the body such that the scrolling is locked. I also notice that I can't click elsewhere on the body to close the modal either like I think you can with regular bootstrap modals. To test, open a modal and then click ESC. the modal will be gone, but you can't scroll.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

frankcarey’s picture

Status: Active » Needs review
FileSize
584 bytes

Here is a patch that overrides the ctools handler for ESC. Basically a 1:1 copy from ctools, but uses the dismiss function instead of close().

adamsro’s picture

Works well for me. Thanks for posting this.

DuaelFr’s picture

I think I came up with a more elegant solution.
It only relies on a event declared by CTools and removes the need to rewrite Drupal.CTools.Modal.dismiss or to bind a new general keypress event.

markhalliwell’s picture

Status: Needs review » Closed (won't fix)
Related issues: +#2397407: Move CSS/JS altering to Libraries API

Sorry bout this. Since the commits in this related issue, this file no longer exists. The plan is to start over with modals completely, using the library extends/overrides where necessary. Also, considering the currently low 8.x CTools usage, I'm inclined to simply add this back in with a separate issue if/when it's ever needed.

joelstein’s picture

Version: 8.x-3.x-dev » 7.x-3.x-dev
Status: Closed (won't fix) » Needs review
FileSize
755 bytes

This issue also exists in Drupal 7. Can we at least get it fixed there with the patch from #3? Re-rolled here against 7.x-3.x-dev.

markhalliwell’s picture

Version: 7.x-3.x-dev » 8.x-3.x-dev
Status: Needs review » Closed (won't fix)
joelstein’s picture

No fix for D7? No explanation? Should I have posted this in a new issue?

markhalliwell’s picture

Hm, I'm not sure why my comment didn't show. But basically I said:

Please don't hi-jack closed issues, especially ones pertaining to different code/branches. There is a reason why we have a "Related issues" field. Create a new issue that references the existing closed issue.

joelstein’s picture