diff --git a/extern/util/CanvasInput.js b/extern/util/CanvasInput.js index 2a7e3035d7..813bba72cf 100755 --- a/extern/util/CanvasInput.js +++ b/extern/util/CanvasInput.js @@ -140,7 +140,7 @@ }, true ); // create the hidden input element - self._hiddenForm = document.createElement('form'); + self._hiddenInput = document.createElement('input'); self._hiddenInput.className = 'entryCanvasHiddenInput'; self._hiddenInput.type = 'text'; @@ -156,8 +156,8 @@ if (self._maxlength) { self._hiddenInput.maxLength = self._maxlength; } - self._hiddenForm.appendChild(self._hiddenInput); - document.body.appendChild(self._hiddenForm); + + document.body.appendChild(self._hiddenInput); self._hiddenInput.value = self._value; // setup the keydown listener self._hiddenInput.addEventListener('keydown', function(e) { @@ -761,7 +761,9 @@ ); input.style.width = self._width; input.style.height = 0; - document.body.appendChild(input); + const form = document.createElement('form'); + form.appendChild(input); + document.body.appendChild(form); input.focus(); input.addEventListener( 'blur', diff --git a/src/class/pixi/etc/PIXICanvasInput.js b/src/class/pixi/etc/PIXICanvasInput.js index 0c0ce28a9a..3565769eee 100644 --- a/src/class/pixi/etc/PIXICanvasInput.js +++ b/src/class/pixi/etc/PIXICanvasInput.js @@ -143,7 +143,6 @@ import * as PIXI from 'pixi.js'; ); // create the hidden input element - self._hiddenForm = document.createElement('form'); self._hiddenInput = document.createElement('input'); self._hiddenInput.className = 'entryCanvasHiddenInput'; self._hiddenInput.type = 'text'; @@ -158,8 +157,7 @@ import * as PIXI from 'pixi.js'; if (self._maxlength) { self._hiddenInput.maxLength = self._maxlength; } - self._hiddenForm.appendChild(self._hiddenInput); - document.body.appendChild(self._hiddenForm); + document.body.appendChild(self._hiddenInput); self._hiddenInput.value = self._value; // setup the keydown listener @@ -792,7 +790,9 @@ import * as PIXI from 'pixi.js'; (self._canvas ? self._canvas.offsetTop : 0)}px`; input.style.width = self._width; input.style.height = 0; - document.body.appendChild(input); + const form = document.createElement('form'); + form.appendChild(input); + document.body.appendChild(form); input.focus(); input.addEventListener( 'blur',