From 24cf345b1c34cce550c416c131d8e1dea41b4562 Mon Sep 17 00:00:00 2001 From: jmoenig Date: Tue, 5 Jan 2021 01:29:53 +0100 Subject: [PATCH] fixed a conversion bug when retrieving a numerical value from an input field --- HISTORY.md | 5 +++++ snap.html | 2 +- src/widgets.js | 6 +++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index ee418c1c..780a11be 100755 --- a/HISTORY.md +++ b/HISTORY.md @@ -4,6 +4,11 @@ * **Notable Changes:** * 10% speed-up for reporters, WARP and TURBO +* **Notable Fixes:** + * fixed a bug when changing a Boolean input slot with a default value to numerical type + +### 2021-01-05 +* widgets: fixed a conversion bug when retrieving a numerical value from an input field ### 2021-01-04 * new dev version diff --git a/snap.html b/snap.html index 9aac2f91..c98305ae 100755 --- a/snap.html +++ b/snap.html @@ -7,7 +7,7 @@ - + diff --git a/src/widgets.js b/src/widgets.js index 79e5c0d8..a7207b64 100644 --- a/src/widgets.js +++ b/src/widgets.js @@ -7,7 +7,7 @@ written by Jens Mönig jens@moenig.org - Copyright (C) 2020 by Jens Mönig + Copyright (C) 2021 by Jens Mönig This file is part of Snap!. @@ -85,7 +85,7 @@ HTMLCanvasElement, fontHeight, SymbolMorph, localize, SpeechBubbleMorph, ArrowMorph, MenuMorph, isString, isNil, SliderMorph, MorphicPreferences, ScrollFrameMorph, MenuItemMorph, Note, useBlurredShadows*/ -modules.widgets = '2020-October-06'; +modules.widgets = '2021-January-05'; var PushButtonMorph; var ToggleButtonMorph; @@ -3100,7 +3100,7 @@ InputFieldMorph.prototype.getValue = function () { var num, contents = this.contents(); if (this.isNumeric) { - num = parseFloat(contents.text); + num = parseFloat(contents.text.text); if (!isNaN(num)) { return num; }