Input Text Element Can't Backspace


I am using code like below and when I pull it up in dev mode it allows me to type in, but not backspace my input (erase it).

@input type: ‘text’

Backspace not working in TextEditorView

Can you be more specific? I can’t tell if you’re asking for help with writing a package or just the normal usage of the application :smile:


Writing a package. Specifically I am working on the script package below. I also linked my pull request since that is an example of code which generating this problem:


Bump on this, its a showstopper bug right now.

I think perhaps we have narrowed it down to input elements on subviews, but unsure


Please don’t bump topics. Discourse offers the tools for everyone to manage what they read for themselves.


Is the text area in question nested inside an editor? I recommend applying the .native-key-bindings class to text areas and any other kind of element where you expect standard browser behaviors for key bindings. Let me know if that helps.


I was also having problems getting user input. Adding native-key-bindings class solved my backspace keybinding issue.

Why doesn't pressing Enter submit <form>?
Custom form in views with babel

This works great. For the curious devs out there, here’s the source.


.native-key-bindings worked great, but broke tab, now I can not move to the next input by pressing tab. Any ideas?


ok, that might be helpful


Just putting my solution here in case anyone else comes along with the same problem like me. This adds the tab and enter functionality back into your input elements.

First, put the native-key-bindings class on your inputs to get backspace to work.
<input class="native-key-bindings">

Then, add key listeners to the input.
inputElement.onkeyDown = function(event){ if(event.key === "Tab"){ if(event.shiftKey){ previousInputElement.focus(); }else{ nextInputElement.focus(); } }else if(event.key === "Enter"){ submitForm(); } }