Skip to content

Commit

Permalink
fix: fix multiple selection on macintosh
Browse files Browse the repository at this point in the history
  • Loading branch information
volishevko committed Sep 20, 2024
1 parent 7aefd7a commit 26c582b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion sources/services/gallery/searchSuggest.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function attachEvents(searchSuggest, searchInput, toggleButton) {
const controlValue = control.getValue();
control.setValue(!controlValue);
}
if (!event.ctrlKey) {
if (!event.metaKey && !event.ctrlKey) {
suggestList.hide();
}
});
Expand Down
8 changes: 7 additions & 1 deletion sources/utils/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,11 @@ function isSafari() {
return navigator.userAgent.indexOf("Safari") > -1;
}

function isMacintosh() {
debugger;
return navigator.userAgent.indexOf("Macintosh") > -1;
}

export default {
openInNewTab,
openImageInNewTab,
Expand Down Expand Up @@ -592,6 +597,7 @@ export default {
shareFile,
isPortrait,
getFilterLabelId,
isSafari
isSafari,
isMacintosh,
};

6 changes: 5 additions & 1 deletion sources/views/subviews/gallery/parts/searchSuggest.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import util from "../../../../utils/util";

function getView() {
/** @type {webix.ui.suggestConfig} */
const view = {
Expand All @@ -9,7 +11,9 @@ function getView() {
multiselect: true,
tooltip: {
view: "tooltip",
template: "Press and hold the left CTRL key to make multiple selections",
template: util.isMacintosh()
? "Press and hold Cmd (⌘) key to make multiple selections"
: "Press and hold left CTRL key to make multiple selections",
}
},
};
Expand Down

0 comments on commit 26c582b

Please sign in to comment.