Text edit input behavior fixed

This commit is contained in:
barsdeveloper
2022-04-18 22:38:50 +02:00
parent d43ae1b11f
commit 2ebd55b31d
15 changed files with 141 additions and 71 deletions

View File

@@ -30,8 +30,7 @@ export default class IMouseClickDrag extends IPointing {
started = false
constructor(target, blueprint, options) {
options.unlistenOnTextEdit
constructor(target, blueprint, options = {}) {
super(target, blueprint, options)
this.clickButton = options?.clickButton ?? 0
this.exitAnyButton = options?.exitAnyButton ?? true

View File

@@ -87,7 +87,7 @@ export default class MouseCreateLink extends IMouseClickDrag {
pin.removeEventListener("mouseenter", this.#mouseenterHandler)
pin.removeEventListener("mouseleave", this.#mouseleaveHandler)
})
if (this.enteredPin) {
if (this.enteredPin && this.linkValid) {
this.blueprint.addGraphElement(this.link)
this.link.destinationPin = this.enteredPin
this.link.setLinkMessage(null)

View File

@@ -0,0 +1,16 @@
import IMouseClickDrag from "./IMouseClickDrag";
/**
* @typedef {import("../../element/PinElement").default} PinElement
*/
/**
* @extends IMouseClickDrag<PinElement>
*/
export default class MouseIgnore extends IMouseClickDrag {
constructor(target, blueprint, options = {}) {
options.consumeEvent = true
super(target, blueprint, options)
}
}