HabitRPG/habitrpg — pull request #4141 by gjoyner (2014-10-13 09:41:35+00:00)
Title: Tags (filters) saves when pressing Enter instead of deleting

This is for https://github.com/HabitRPG/habitrpg/issues/3983. The issue was that when editing a tag, when you pressed Enter, it would delete the tag you were editing. It was a legitimate annoyance. Now hitting enter instead saves the changes instead of deleting.
Technical details: when using , if you don't set a type it will default to type="submit". When the is a submit, and especially if it's a single input outside of the button, Enter is assumed to be a submission AND is considered a mouse click. Changing the button's type to type="button" however stops the Enter key from submitting. From there, just setup a ng-keyup function to check for the Enter key, and if so, save.