Преглед изворни кода

fix: Add support for mac command key for selection manager (#3315)

21_Reinite пре 1 година
родитељ
комит
c1cfb73704

+ 2 - 2
packages/admin-ui/src/lib/core/src/common/utilities/selection-manager.ts

@@ -47,13 +47,13 @@ export class SelectionManager<T> {
                 ...this.items.slice(start, end).filter(a => !this._selection.find(s => itemsAreEqual(a, s))),
             );
         } else if (index === -1) {
-            if (multiSelect && (event?.ctrlKey || event?.shiftKey || additiveMode)) {
+            if (multiSelect && ((event?.ctrlKey || event?.metaKey) || event?.shiftKey || additiveMode)) {
                 this._selection.push(item);
             } else {
                 this._selection = [item];
             }
         } else {
-            if (multiSelect && event?.ctrlKey) {
+            if (multiSelect && (event?.ctrlKey || event?.metaKey)) {
                 this._selection.splice(index, 1);
             } else if (1 < this._selection.length && !additiveMode) {
                 this._selection = [item];