From 98e0bef1b75b28ab6853420a5278d1ec5550c523 Mon Sep 17 00:00:00 2001 From: Alex Andreev Date: Mon, 29 Nov 2021 18:47:39 +0300 Subject: [PATCH] Clean up Signed-off-by: Alex Andreev --- src/renderer/components/hotbar/hotbar-menu.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/renderer/components/hotbar/hotbar-menu.tsx b/src/renderer/components/hotbar/hotbar-menu.tsx index 522fcca027..897d4c0360 100644 --- a/src/renderer/components/hotbar/hotbar-menu.tsx +++ b/src/renderer/components/hotbar/hotbar-menu.tsx @@ -33,7 +33,7 @@ import { HotbarSelector } from "./hotbar-selector"; import { HotbarCell } from "./hotbar-cell"; import { HotbarIcon } from "./hotbar-icon"; import { defaultHotbarCells, HotbarItem } from "../../../common/hotbar-types"; -import { makeObservable, observable } from "mobx"; +import { action, makeObservable, observable } from "mobx"; interface Props { className?: IClassName; @@ -62,10 +62,12 @@ export class HotbarMenu extends React.Component { return catalogEntityRegistry.getById(item?.entity.uid) ?? null; } + @action onDragStart() { this.draggingOver = true; } + @action onDragEnd(result: DropResult) { const { source, destination } = result; @@ -181,7 +183,7 @@ export class HotbarMenu extends React.Component { return (
- + this.onDragStart()} onDragEnd={(result) => this.onDragEnd(result)}> {this.renderGrid()}