Put hidden input field at the top

The input field was placed at the bottom, but that lead to some
cutting of the top on mobile Chrome. Putting it at the top seems
to work fine in both Chrome and Fennec.
This commit is contained in:
Volker Mische 2021-02-28 17:26:15 +01:00
parent 52acc143f6
commit 4b2af705a3

View File

@ -22,7 +22,7 @@ export class TextInput extends Phaser.GameObjects.BitmapText {
inputElement.maxLength = maxLength inputElement.maxLength = maxLength
// Make sure that now scolling is needed and that the input field is // Make sure that now scolling is needed and that the input field is
// not visible // not visible
inputElement.setAttribute('style', 'opacity:0;position:absolute;bottom:0'); inputElement.setAttribute('style', 'opacity:0;position:absolute;top:0');
mainContainer.appendChild(inputElement); mainContainer.appendChild(inputElement);
inputElement.addEventListener('input', this.onInput.bind(this) as EventListener); inputElement.addEventListener('input', this.onInput.bind(this) as EventListener);