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 && }