codementum / experimentr

Backend (Node.js, redis), frontend (js), and analysis (R) for web-based visualization studies.
29 stars 16 forks source link

Add backspace halt code to prevent accidental back navigation #68

Closed connorgr closed 8 years ago

connorgr commented 8 years ago

In the current implementation pressing backspace accidentally outside of a form can result in a huge headache, since the browser will move away from Experimentr. Now, the default behavior of pressing backspace is muted, unless its in a text-entry form.

This might need another pass if there are other text-interactable elements other than INPUT and TEXTAREA where back space might be used.

codementum commented 8 years ago

Very nice! I was just reading about how Chrome is disabling backspace in future versions, but this looks cross-browser.

One question, though: would it make more sense to put it in experimentr.js, so it's "invisibly" loaded with a new experiment? I could imagine wrapping it in an options function, but that can come later...

connorgr commented 8 years ago

Good point. Fixed in 0d3bdcd2dab938c2bd5e5623cd65e2a65f6d4931

codementum commented 8 years ago

(ps: It says the branch can be safely deleted now-- does that make sense to you?)

connorgr commented 8 years ago

I've always thought it was verification for a local git branch -D?