diff --git a/src/actions/actionDeleteSelected.tsx b/src/actions/actionDeleteSelected.tsx index d3c3d3a5..6bc15572 100644 --- a/src/actions/actionDeleteSelected.tsx +++ b/src/actions/actionDeleteSelected.tsx @@ -18,13 +18,14 @@ export const actionDeleteSelected: Action = { contextMenuOrder: 3, commitToHistory: (_, elements) => isSomeElementSelected(elements), keyTest: event => event.key === KEYS.BACKSPACE || event.key === KEYS.DELETE, - PanelComponent: ({ updateData }) => ( + PanelComponent: ({ elements, updateData }) => ( updateData(null)} + visible={isSomeElementSelected(elements)} /> ), }; diff --git a/src/actions/actionFinalize.tsx b/src/actions/actionFinalize.tsx index 44770285..814c3898 100644 --- a/src/actions/actionFinalize.tsx +++ b/src/actions/actionFinalize.tsx @@ -5,7 +5,7 @@ import { isInvisiblySmallElement } from "../element"; import { resetCursor } from "../utils"; import React from "react"; import { ToolButton } from "../components/ToolButton"; -import { save } from "../components/icons"; +import { done } from "../components/icons"; import { t } from "../i18n"; export const actionFinalize: Action = { @@ -16,10 +16,13 @@ export const actionFinalize: Action = { window.document.activeElement.blur(); } if (appState.multiElement) { - appState.multiElement.points = appState.multiElement.points.slice( - 0, - appState.multiElement.points.length - 1, - ); + // pen and mouse have hover + if (appState.lastPointerDownWith !== "touch") { + appState.multiElement.points = appState.multiElement.points.slice( + 0, + appState.multiElement.points.length - 1, + ); + } if (isInvisiblySmallElement(appState.multiElement)) { newElements = newElements.slice(0, -1); } @@ -50,12 +53,12 @@ export const actionFinalize: Action = { PanelComponent: ({ appState, updateData }) => (
updateData(null)} diff --git a/src/appState.ts b/src/appState.ts index 9d4472fd..95f047d1 100644 --- a/src/appState.ts +++ b/src/appState.ts @@ -30,6 +30,7 @@ export function getDefaultAppState(): AppState { selectionElement: null, zoom: 1, openedMenu: null, + lastPointerDownWith: "mouse", }; } diff --git a/src/components/LanguageList.tsx b/src/components/LanguageList.tsx index ca75c5c5..c64fdb9a 100644 --- a/src/components/LanguageList.tsx +++ b/src/components/LanguageList.tsx @@ -5,15 +5,19 @@ export function LanguageList({ onChange, languages, currentLanguage, + floating, }: { languages: { lng: string; label: string }[]; onChange: (value: string) => void; currentLanguage: string; + floating?: boolean; }) { return ( { return (