Check attribute value against the current value before setting it. Helps... #447

Open
wants to merge 1 commit into from

2 participants

@ghost

... in the case of iframe.url where resetting the value will refresh the iframe.

caseycorcoran Check attribute value against the current value before setting it. He…
…lps in the case of iframe.url where resetting the value will refresh the iframe.
a4d3789
@mbest
Knockout.js member

This is good, but also see #362. Probably the == and != should be === and !==.

@ghost

Thanks Michael, I never took the time to look up strict equality operators... glad this issue led me to :)

@SteveSanderson

Strictly speaking this is a breaking change (someone might be relying on this behavior already to cause refreshes) so I'd give this a low priority and review it near the end of the 2.2 cycle if we still have capacity.

@mbest
Knockout.js member

I agree we can wait on this. I'll set the waiting label.

@ghost

Sure, I wrote a custom binding to get around it... so it's workable. You might want to add something to the documentation though. Thanks!

@mbest
Knockout.js member

See #669 for more discussion on this topic.

@mbest
Knockout.js member

Another counter argument to this change is shown in #1646. The value of an <option> element defaults to the text of that element, but setting the value overrides that behavior, even if the value you set is the same as the current text (and thus the current value).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment