0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

🐛 Koenig - Fixed card click-to-deselect in Safari/Firefox

refs https://github.com/TryGhost/Ghost/issues/9623
- only Chrome exposes `MouseEvent.path` so use `MouseEvent.composedPath()` for Safari/FF support
This commit is contained in:
Kevin Ansfield 2018-06-20 17:34:50 +01:00
parent e4dca1cb70
commit 749839a8e1

View file

@ -232,7 +232,14 @@ export default Component.extend({
// exit edit mode any time we have a click outside of the card unless it's
// a click inside one of our modals or on the plus menu
_handleClick({target, path}) {
_handleClick(event) {
let {target, path} = event;
// Safari doesn't expose MouseEvent.path
if (!path) {
path = event.composedPath();
}
let searchPath = function (selector) {
return element => element.closest && element.closest(selector);
};