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:
parent
e4dca1cb70
commit
749839a8e1
1 changed files with 8 additions and 1 deletions
|
@ -232,7 +232,14 @@ export default Component.extend({
|
||||||
|
|
||||||
// exit edit mode any time we have a click outside of the card unless it's
|
// 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
|
// 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) {
|
let searchPath = function (selector) {
|
||||||
return element => element.closest && element.closest(selector);
|
return element => element.closest && element.closest(selector);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue