Skip to content

Commit 8cc2d08

Browse files
author
Dmitry Berezovsky
committed
Fixed issue #2: Enter-key submits form when selecting a location
1 parent 3567fb4 commit 8cc2d08

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

locationpicker.jquery.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@
137137
context.settings.onchanged(GmUtility.locationFromLatLng(context.location), context.radius, false);
138138
});
139139
});
140+
// Prevent form from being submitted if user hit enter.
141+
inputBinding.locationNameInput.keypress(function(event){
142+
if (event.keyCode === 13){ return false; }
143+
});
140144
}
141145
if (inputBinding.latitudeInput) {
142146
inputBinding.latitudeInput.on("change", function() {

locationpicker.jquery.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"map",
1010
"radius"
1111
],
12-
"version": "0.1.5",
12+
"version": "0.1.6",
1313
"author": {
1414
"name": "Dmitry Berezovsky",
1515
"url": "http://logicify.com/"

0 commit comments

Comments
 (0)