mirror of
https://github.com/FoggedLens/iD.git
synced 2026-03-03 09:53:40 +00:00
Fix bug causing 0 to be written into a numeric field when tabbing
(closes #5087)
This commit is contained in:
@@ -110,11 +110,13 @@ export function uiFieldText(field, context) {
|
||||
function change(onInput) {
|
||||
return function() {
|
||||
var t = {};
|
||||
var val = utilGetSetValue(input) || undefined;
|
||||
var val = utilGetSetValue(input).trim() || undefined;
|
||||
|
||||
if (!onInput && field.type === 'number') {
|
||||
val = clamped(parsed(val)) + '';
|
||||
utilGetSetValue(input, val);
|
||||
if (!onInput) {
|
||||
if (field.type === 'number' && val !== undefined) {
|
||||
val = clamped(parsed(val)) + '';
|
||||
}
|
||||
utilGetSetValue(input, val || '');
|
||||
}
|
||||
t[field.key] = val;
|
||||
dispatch.call('change', this, t, onInput);
|
||||
|
||||
Reference in New Issue
Block a user