Web: Files: fix tile check logic
This commit is contained in:
parent
e6e7afd1f7
commit
a7c5e5cb5e
@ -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}
|
||||
>
|
||||
<FilesTileContent
|
||||
item={item}
|
||||
@ -116,9 +118,11 @@ const FileTile = (props) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default inject(({ settingsStore }) => {
|
||||
export default inject(({ settingsStore, filesStore }) => {
|
||||
const { getIcon } = settingsStore;
|
||||
return { getIcon };
|
||||
const { setSelection } = filesStore;
|
||||
|
||||
return { getIcon, setSelection };
|
||||
})(
|
||||
withTranslation(["Home", "InfoPanel"])(
|
||||
withRouter(
|
||||
|
@ -371,9 +371,15 @@ 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.target.nodeName === "INPUT" || e.target.nodeName === "rect") {
|
||||
onSelect && onSelect(!checked, item);
|
||||
} else {
|
||||
setSelection && setSelection([]);
|
||||
onSelect && onSelect(!checked, item);
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
|
Loading…
Reference in New Issue
Block a user