Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions webcompat/static/js/lib/bugform.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ function BugForm() {
this.stepsToReproduceField = this.inputs.steps_reproduce.el;

this.init = function() {
// prevent accidental submission with the Enter key
// (for now, just the description input)
Mousetrap.bind("enter", function(e) {
if (e.target.className.indexOf("js-Desc") !== -1) {
e.preventDefault();
}
});

this.checkParams();
this.disableSubmits();
this.urlField.on("blur input", _.bind(this.checkURLValidity, this));
Expand Down
2 changes: 1 addition & 1 deletion webcompat/templates/home-page/form.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ <h3 class="wc-Title--s">Report Site Issue</h3>
{% endif %}
</div>
<span class="wc-Form-validation">
{{ form.description(class_='wc-Form-item required',
{{ form.description(class_='wc-Form-item required mousetrap js-Desc',
placeholder="e.g. The video doesn't play",
required=True, type='text', pattern='') }}
</span>
Expand Down