From b8dd9bc21a866f8650b5deacc720f829179b68ad Mon Sep 17 00:00:00 2001 From: Mavrik Date: Mon, 3 Jul 2023 23:40:35 +0200 Subject: [PATCH] fix: code cleanup --- src/components/DeviceSelect/DeviceSelect.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/DeviceSelect/DeviceSelect.tsx b/src/components/DeviceSelect/DeviceSelect.tsx index 146a1724..52398e15 100644 --- a/src/components/DeviceSelect/DeviceSelect.tsx +++ b/src/components/DeviceSelect/DeviceSelect.tsx @@ -48,7 +48,10 @@ const DeviceSelect: FC = ({ devices, value, uiMode, type }) = } const toggleDropdown = () => toggle((prevState) => !prevState) - const confirmDelete = (deviceKey: string) => setTargetKey(deviceKey) + const confirmDelete = (e: MouseEvent, deviceKey: string) => { + e.stopPropagation() + setTargetKey(deviceKey) + } const closeConfirm = () => setTargetKey('') const deleteDevice = () => { @@ -125,10 +128,7 @@ const DeviceSelect: FC = ({ devices, value, uiMode, type }) = {deviceKey} ) => { - e.stopPropagation() - confirmDelete(deviceKey) - }} + onClick={(e) => confirmDelete(e, deviceKey)} className='bi bi-trash-fill hidden group-hover:block' /> {isLocked && }