Skip to content

Commit

Permalink
Merge pull request #3970 from node-red/prevent-text-selection
Browse files Browse the repository at this point in the history
Prevent dbl-click opening node edit dialog with text selected
  • Loading branch information
knolleary committed Dec 3, 2022
2 parents 4bb2b91 + e804add commit 113d42e
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3369,6 +3369,9 @@ RED.view = (function() {
}
if (dblClickPrimed && mousedown_node == d && clickElapsed > 0 && clickElapsed < dblClickInterval) {
mouse_mode = RED.state.DEFAULT;
// Avoid dbl click causing text selection.
d3.event.preventDefault()
document.getSelection().removeAllRanges()
if (d.type != "subflow") {
if (/^subflow:/.test(d.type) && (d3.event.ctrlKey || d3.event.metaKey)) {
RED.workspaces.show(d.type.substring(8));
Expand Down

0 comments on commit 113d42e

Please sign in to comment.