kupriyanenko / jbone

JavaScript Library for Events and DOM manipulation. Replaces jQuery for Backbone (2.5kb gzipped)
http://jbone.js.org
MIT License
279 stars 35 forks source link

Handle undefined parameter for jBone.val() #61

Closed mateusvelleda closed 5 years ago

mateusvelleda commented 6 years ago

This way it's not going to set "undefined" to a input when an undefinedor null value is passed. jQuery handles this way - check https://github.com/jquery/jquery/blob/master/src/attributes/val.js#L61 An example is:

const a = {b: 'b'}
$('input').val(a.c)

currently jBone will set "undefined" as the input's value

mateusvelleda commented 6 years ago

I left an example here https://codepen.io/mvellar/pen/GBpGdE?editors=1010