Fixes bug where pressing delete key while editing text will suggest... (#1083)

* Fixes bug where pressing delete key while editing text will suggest the deletion of selected map entities

* Changed the DEL key to remove entities instead of delete them
This commit is contained in:
Robert Best 2017-03-06 11:48:59 -05:00 committed by GitHub
parent 4ff9619837
commit 153cc38d1a

View file

@ -32,8 +32,11 @@ const Listeners = {
JIT.escKeyHandler()
break
case 46: // if DEL is pressed
e.preventDefault()
Control.deleteSelected()
if(e.target.tagName !== "INPUT" && e.target.tagName !== "TEXTAREA" && (Selected.Nodes.length + Selected.Edges.length) > 0){
e.preventDefault()
Control.removeSelectedNodes()
Control.removeSelectedEdges()
}
break
case 65: // if a or A is pressed
if (Create.isSwitchingSet && e.ctrlKey || e.metaKey) {