@@ -158,42 +158,15 @@ function input(::WidgetTheme, o; extra_js=js"", extra_obs=[], label=nothing, typ
158
158
(o isa AbstractObservable) || (o = Observable (o))
159
159
(changes isa AbstractObservable) || (changes = Observable (changes))
160
160
data = Pair{String, Any}[" changes" => changes, bindto => o]
161
- if isnumeric
162
- bindtoString = bindto* " String"
163
- oString = Observable (string (something (o[], " " )))
164
- push! (data, bindtoString => oString)
165
- string_js = js """
166
- var obs = this .$ (WebIO .JSString (bindto));
167
- var obsString = this .$ (WebIO .JSString (bindtoString));
168
- obsString .subscribe (function (value ) {
169
- var val = parseFloat (value);
170
- if (! isNaN (val)) {
171
- obs (val);
172
- }
173
- })
174
- obs .subscribe (function (value ) {
175
- var str = JSON .stringify (value);
176
- if ((str == " 0" ) && ([" -0" , " -0." ].indexOf (obsString ()) >= 0 ))
177
- return ;
178
- if ([" null" , " " ].indexOf (str) >= 0 )
179
- return ;
180
- obsString (str);
181
- })
182
- """
183
- extra_js = js """
184
- $string_js
185
- $extra_js
186
- """
187
- else
188
- bindtoString = bindto
189
- oString = o
161
+ if isnumeric && bind == " value"
162
+ bind = " numericValue"
190
163
end
191
164
append! (data, (string (key) => val for (key, val) in extra_obs))
192
165
countChanges = js_lambda (" this.changes(this.changes()+1)" )
193
166
attrDict = merge (
194
167
attributes,
195
168
Dict (:type => typ,
196
- Symbol (" data-bind" ) => " $bind : $bindtoString , valueUpdate: '$valueUpdate ', event: {change: $countChanges }"
169
+ Symbol (" data-bind" ) => " $bind : $bindto , valueUpdate: '$valueUpdate ', event: {change: $countChanges }"
197
170
)
198
171
)
199
172
className = mergeclasses (getclass (:input , wdgtyp), className)
0 commit comments