Skip to content

Commit

Permalink
Unselect desktop icons if root was clicked (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
andersevenrud committed Sep 12, 2019
1 parent c06e003 commit fef05a3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/adapters/ui/iconview.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ const view = (fileIcon, themeIcon, droppable) => (state, actions) =>
h('div', {
class: 'osjs-desktop-iconview__wrapper',
oncontextmenu: ev => actions.openContextMenu({ev}),
onclick: ev => {
if (ev.target && ev.target.classList.contains('osjs-desktop-iconview__wrapper')) {
actions.selectEntry({index: -1});
}
},
oncreate: el => {
droppable(el, {
ondrop: (ev, data, files) => {
Expand Down Expand Up @@ -234,6 +239,8 @@ export class DesktopIconView extends EventEmitter {
return {selected: index};
} else {
this.createRootContextMenu(ev);

return {selected: -1};
}
},

Expand Down

0 comments on commit fef05a3

Please sign in to comment.