kanta
March 31, 2026, 6:50am
1
Hello,
I would like to report a potential issue that I encountered after upgrading dhtmlxDiagram from v6.0.11 to v6.1.1 .
Summary
After the upgrade, the behavior of the Delete / Backspace keys during inline text editing (e.g., lineTitle) has changed unexpectedly.
Steps to reproduce
Use dhtmlxDiagram v6.1.1
Double-click a lineTitle (or similar editable element) to enter text edit mode
Place the cursor inside the text
Press Delete or Backspace
Actual behavior
The entire diagram item (e.g., the line or shape) is removed
Expected behavior
Only the text content (item.text) should be modified/deleted
This was the behavior in v6.0.11
Additional context
It seems this behavior is related to the hotkey changes introduced in v6.1.1:
If you are updating Diagram from an older version, check Migration to Newer Version for details. | You can learn a new information about DHTMLX JavaScript Diagram library. Browse developer guides and API reference, try out code examples and live...
Workaround
I implemented a workaround by overriding the hotkeys and checking whether the text editor is active before removing the item:
const editor = new dhx.DiagramEditor(document.body, {
type: "default",
hotkeys: {
'delete': () => checkRemoveItem(),
'backspace': () => checkRemoveItem(),
}
});
const checkRemoveItem = () => {
const target = ["lineTitle", "circle"];
const selected = editor.diagram.selection.getItem();
if (selected !== undefined) {
if (target.includes(selected.type)) {
const element = document.querySelector(
`[dhx_editor_id="${selected.id}_editor"]`
);
if (element && element.contains(document.activeElement)) {
// editing text → do nothing
} else {
editor.diagram.data.remove(selected.id);
}
} else {
editor.diagram.data.remove(selected.id);
}
}
};
Question
Is this change in behavior intentional?
If so, is there an official way to distinguish between “text editing mode” and “item selection mode” when handling hotkeys?
Thank you for your support.
Hello @kanta ,
Thank you for the detailed description of the issue and provided workaround.
It’s not an intentional change, and the dev team already works on a fix, I will notify you on any updates.
Warm regards,
1 Like
Hello @kanta ,
The dev team already fixed the issue with edit mode in the latest release:
You can learn a new information about DHTMLX JavaScript Diagram library. Browse developer guides and API reference, try out code examples and live demos, and download a free 30-day evaluation version of DHTMLX Diagram.
You can test it in the following demo:
Warm regards.,
kanta
April 2, 2026, 10:20pm
4
@Siarhei
Hello,
Thank you for fixing the Backspace key behavior in the latest release.
While reviewing the hotkey behavior, I noticed the following regarding the Delete key .
After verification, I found that the behavior is the same in both v6.0.11 and v6.1.2.
Specifically, when editing text (e.g., lineTitle) and the cursor is active inside the text field, pressing the Delete key is handled as a hotkey and removes the entire item, instead of modifying the text.
Since this behavior is consistent across versions, it seems this may be the intended design.
Could you please clarify whether handlizng the Delete key as a hotkey even during text editing is expected behavior?
Thank you for your support.
Best regards,
kanta
Hello @kanta ,
It is designed behavior, but we plan to slightly change in the upcoming release to make it more expectable and clear.
So the delete/backspace will work in the same way(likely there will be few more behavior changes).
Warm regards,
Hello @kanta ,
The dev team already fixed the issue with shortcuts in the latest release:
If you are updating Diagram from an older version, check Migration to Newer Version for details. | You can learn a new information about DHTMLX JavaScript Diagram library. Browse developer guides and API reference, try out code examples and live...
Here is an example where it can be tested:
Warm regards,