Skip to content

Commit fef05a3

Browse files
committed
Unselect desktop icons if root was clicked (#51)
1 parent c06e003 commit fef05a3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/adapters/ui/iconview.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ const view = (fileIcon, themeIcon, droppable) => (state, actions) =>
4848
h('div', {
4949
class: 'osjs-desktop-iconview__wrapper',
5050
oncontextmenu: ev => actions.openContextMenu({ev}),
51+
onclick: ev => {
52+
if (ev.target && ev.target.classList.contains('osjs-desktop-iconview__wrapper')) {
53+
actions.selectEntry({index: -1});
54+
}
55+
},
5156
oncreate: el => {
5257
droppable(el, {
5358
ondrop: (ev, data, files) => {
@@ -234,6 +239,8 @@ export class DesktopIconView extends EventEmitter {
234239
return {selected: index};
235240
} else {
236241
this.createRootContextMenu(ev);
242+
243+
return {selected: -1};
237244
}
238245
},
239246

0 commit comments

Comments
 (0)