diff --git a/products/ASC.Files/Client/src/HOCs/withHotkeys.js b/products/ASC.Files/Client/src/HOCs/withHotkeys.js index b22aa5532c..b1ab41133e 100644 --- a/products/ASC.Files/Client/src/HOCs/withHotkeys.js +++ b/products/ASC.Files/Client/src/HOCs/withHotkeys.js @@ -49,8 +49,8 @@ const withHotkeys = (Component) => { filterPreventDefault: false, enableOnTags: ["INPUT"], enabled: !someDialogIsOpen && enabledHotkeys && !mediaViewerIsVisible, - keyup: true, - keydown: false, + // keyup: true, + // keydown: false, }; const onKeyDown = (e) => activateHotkeys(e); @@ -130,21 +130,21 @@ const withHotkeys = (Component) => { useHotkeys( "Shift+s", () => setAction({ type: FileAction.Create, extension: "xlsx", id: -1 }), - hotkeysFilter + { ...hotkeysFilter, ...{ keyup: true } } ); //Crete presentation useHotkeys( "Shift+p", () => setAction({ type: FileAction.Create, extension: "pptx", id: -1 }), - hotkeysFilter + { ...hotkeysFilter, ...{ keyup: true } } ); //Crete form template useHotkeys( "Shift+o", () => setAction({ type: FileAction.Create, extension: "docxf", id: -1 }), - hotkeysFilter + { ...hotkeysFilter, ...{ keyup: true } } ); //Crete form template from file @@ -158,7 +158,7 @@ const withHotkeys = (Component) => { useHotkeys( "Shift+f", () => setAction({ type: FileAction.Create, id: -1 }), - hotkeysFilter + { ...hotkeysFilter, ...{ keyup: true } } ); //Delete selection diff --git a/products/ASC.Files/Client/src/pages/Home/Section/Body/TilesView/FileTile.js b/products/ASC.Files/Client/src/pages/Home/Section/Body/TilesView/FileTile.js index 94eeba8a79..bfc7268370 100644 --- a/products/ASC.Files/Client/src/pages/Home/Section/Body/TilesView/FileTile.js +++ b/products/ASC.Files/Client/src/pages/Home/Section/Body/TilesView/FileTile.js @@ -40,6 +40,7 @@ const FileTile = (props) => { getContextModel, onHideContextMenu, thumbSize, + setSelection, } = props; const temporaryExtension = @@ -103,6 +104,7 @@ const FileTile = (props) => { : t("Translations:TitleShowActions") } showHotkeyBorder={showHotkeyBorder} + setSelection={setSelection} > { ); }; -export default inject(({ settingsStore }) => { +export default inject(({ settingsStore, filesStore }) => { const { getIcon } = settingsStore; - return { getIcon }; + const { setSelection } = filesStore; + + return { getIcon, setSelection }; })( withTranslation(["Home", "InfoPanel"])( withRouter( diff --git a/products/ASC.Files/Client/src/pages/Home/Section/Body/TilesView/sub-components/Tile.js b/products/ASC.Files/Client/src/pages/Home/Section/Body/TilesView/sub-components/Tile.js index 15b95716cf..031edb9ae7 100644 --- a/products/ASC.Files/Client/src/pages/Home/Section/Body/TilesView/sub-components/Tile.js +++ b/products/ASC.Files/Client/src/pages/Home/Section/Body/TilesView/sub-components/Tile.js @@ -371,9 +371,16 @@ class Tile extends React.PureComponent { onSelect && onSelect(true, item); }; - onFileClick = () => { - const { onSelect, item, checked } = this.props; - onSelect && onSelect(!checked, item); + onFileClick = (e) => { + const { onSelect, item, checked, setSelection } = this.props; + if (e.detail === 1) { + if (e.target.nodeName === "INPUT" || e.target.nodeName === "rect") { + onSelect && onSelect(!checked, item); + } else { + setSelection && setSelection([]); + onSelect && onSelect(!checked, item); + } + } }; render() {