# Cannot press spacebar in the textarea HTML element

**URL:** <https://phaser.discourse.group/t/cannot-press-spacebar-in-the-textarea-html-element/9178>\
**Category:** Phaser 3\
**Created:** [March 26, 2021, 9:19am UTC](https://phaser.discourse.group/t/cannot-press-spacebar-in-the-textarea-html-element/9178 "2021-03-26T09:19:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ritwizsinha](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/ritwizsinha/32/4976_2.png) [@ritwizsinha](https://phaser.discourse.group/u/ritwizsinha)\
**Post date:** [March 26, 2021, 9:19am UTC](https://phaser.discourse.group/t/cannot-press-spacebar-in-the-textarea-html-element/9178/1 "2021-03-26T09:19:26Z")

</div>

Hi I was starting with Phaser, I have used Phaser 3 and setup phaser with typescript and webpack, My HTML file looks like this

```javascript
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Type it Out</title>
    <style>
        .content {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }
        .content_box {
            margin: 10px;
            padding: 10px;
            text-align: center;
            border: 1px solid black;
        }
        .content_input {
            width: 100%;
        }
        .content_input textarea {
            width: 100%;
            display: inline;
        }
    </style>
</head>
<body>
    <div class="content">
        <div class="content_box" id="textBox">
            
        </div>
        <div class="content_input">
            <textarea rows="4" id="inputBox" ></textarea>
        </div>
    </div>
    <textarea rows="4"></textarea>
    <script src="bundle.js"></script>
</body>
</html>

```

and this is my main typescript file

```javascript
import Phaser from 'phaser';
import { GameScene } from './Scenes/GameScene';
import { SpeedController } from './controllers/SpeedController';

(() => {
	const config = {
		type: Phaser.AUTO,
		parent: 'phaser-example',
		width: 800,
		height: 600,
		backgroundColor: '#000',
		scene: [GameScene],
		physics: {
			default: "arcade",
			arcade: {
			  debug: true
			}
		  },
	};
	
	const game = new Phaser.Game(config);
	const speedController = new SpeedController();
	game.scene.start('GameScene', {
		speedController,
	});

	const textBox = document.getElementById('textBox');
	
	const getRandomText = async () => {
		const text = "become aware of happiness once you have lost it. Then an age comes, a second one, in which you already know, at the moment when you begin to experience true happiness, that you are, at the end of the day, going to lose it. When I met Belle, I understood that I had just entered this second age. I also understood that I hadn’t reached the third age, in which anticipation of the loss of happiness prevents you from living.";
		return Promise.resolve(text);
	}
	
	if (textBox) {
		getRandomText().then(text => textBox.innerHTML = text);
	} 
	
	
	const inputBox = document.getElementById('inputBox');
	let inputString = "";

	if (inputBox) {
		inputBox.addEventListener('input', (e) => console.log(e));
		const inputString = inputBox.textContent;
		console.log(inputString);
	}	
	
})();

```

The textarea never allows a space entry.  
I tried this [solution](https://phaser.discourse.group/t/cannot-press-spacebar-when-phaser-on-same-page/5001)  
and added game.input.keyboard.clearCaptures() but nothing happened.  
When I try to add this line in my scene constructor I get error ie this.input is undefined.  
When I add this statement to create function nothing happens.

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [March 26, 2021, 2:59pm UTC](https://phaser.discourse.group/t/cannot-press-spacebar-in-the-textarea-html-element/9178/2 "2021-03-26T14:59:49Z")

</div>

👋

Are you using the SPACE key in Phaser anywhere?

---

<div class="post-metadata">

**Author:** ![ritwizsinha](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/ritwizsinha/32/4976_2.png) [@ritwizsinha](https://phaser.discourse.group/u/ritwizsinha)\
**Post date:** [March 27, 2021, 6:55am UTC](https://phaser.discourse.group/t/cannot-press-spacebar-in-the-textarea-html-element/9178/3 "2021-03-27T06:55:46Z")

</div>

No infact I am not using any keyboard function currently in the game, I have currently used

```javascript
input: {
keyboard: false
}

```

in the game config currently to temporarily solve the problem.  
I although do intend to use keyboard and add functionalities later, but that would cause problem with textarea

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [March 27, 2021, 3:30pm UTC](https://phaser.discourse.group/t/cannot-press-spacebar-in-the-textarea-html-element/9178/4 "2021-03-27T15:30:46Z")

</div>

I don’t know what’s happening then. Phaser shouldn’t capture any keys unless you add one.

 ![hello](https://global.discourse-cdn.com/free1/uploads/phaser1/original/2X/d/d1136599213f352fa0927aabe685ef2c9c676b58.jpeg)
