Closed abradley2 closed 7 years ago
This sounds like a valid fix. Are we sure hasAttribute
works the same way in older browsers? Speaking of, @maxogden is there a cut-off for browser support for this library?
@toddself iirc so far for choo we've been targeting IE10+ because anything below that is like 1% market share - which is less than mobile Opera and most people don't really account for that - can't speak for yo-yo
ofcourse, but I would assume it'd follow something pragmatic (:
FWIW, hasAttributeNS()
is supported in IE as far back as 9. In IE8, you’d have to fall back to either hasAttribute()
or the attributes
property.
Errr, sorry, I had misread/miscarried some conversation from #66 over here; I see this isn’t using hasAttributeNS()
. Anyway, hasAttribute()
works at least as far back as IE8. I don’t have an older IE to test.
This looks like a needed fix - any chance this could get merged?
@yoshuawuyts @maxogden @shama Can we merge this pretty please? Thank you kindly.
v1.4.1
*Updated based on some discussion in this issue
Because an input that looks like this
<input type='text'/>
will still have avalue
of""
, theel.value
method can't be used to distinguish between how it should update different than something like<input type='text' value="" />
Use case:
Between updates:
<input type='text' />
= will copy over the value, becausehasAttribute('value')
will return false even after user input<input type='text' value=${val} />
will set the value to whateverval
is, even if it is an empty string, becausehasAttribute('value')
will return trueThis relates to the issue here: https://github.com/maxogden/yo-yo/issues/66