Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

select binding: order of 'options' and 'value' matters in FF and Chrome #58

Closed
philmueller opened this issue Mar 2, 2011 · 7 comments
Closed

Comments

@philmueller
Copy link

The order of 'options' and 'value' seems to matter in a select binding, at least for non-IE browsers. This http://jsfiddle.net/gfCza/ works as expected in IE, but not in Firefox/Chrome (the second example doesn't show a result until you select something in the combobox).

@ScottWeinstein
Copy link

getting the same in v1.2.1

@lukeholder
Copy link

your jsfiddle example is working for me in chrome 12 on a mac.

@ProggerPete
Copy link

philmueller's example is still broken in chrome 13 on pc.

Here's another case where the order of the bind properties matters.

http://jsfiddle.net/ProggerPete/488C7/1/

@SteveSanderson
Copy link
Contributor

Indeed, the order of bindings is meant to be significant. They run in the order they appear in your data-bind attribute.

However, the behavior on IE should not differ from Firefox/Chrome, so there is definitely some bug here. I'll investigate.

@ProggerPete
Copy link

Does binding order being significant make sense though? I understand that this is how it currently works, but wouldn't it be better and more intuitive if the order was not significant?

In the case of the options and value bindings working together, wouldn't it be easy enough to make the options binding check for a value binding and apply it?

There would definitely need to be some thought put into exactly how the bindings would collaborate with each other, but I think the framework would be better for it.

@SteveSanderson
Copy link
Contributor

Does binding order being significant make sense though?

In general, you can put custom code into bindings, so it's always possible that what you do there cares about order of application.

For the built-in bindings, I agree it's desirable to make them as order-agnostic as possible. The options/value combination is the only common scenario where ordering is noticable, so I'd definitely like to smooth that out.

@SteveSanderson
Copy link
Contributor

Thanks very much for reporting this, and for providing the test cases. Now fixed in the latest source code.

Sorry it took such a long time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants