Skip to content

IE should prefer bound props over static props other than class #1703

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

Merged
merged 3 commits into from
Nov 4, 2015
Merged

IE should prefer bound props over static props other than class #1703

merged 3 commits into from
Nov 4, 2015

Conversation

fergaldoyle
Copy link
Contributor

A follow on from: #1639

There are more attributes other than title which IE has issues with. (id, lang, language,dir, etc)
e.g: http://codepen.io/anon/pen/yYxBPy

In this PR, we feature detect binding syntax issues, if the current browser does have this issue, we check every prop for a bound alternative, (:, v-bind:, *.sync, *.once) and if present, use the bound prop over a static prop.

class is ignored. Buy ignoring it the behavior matches other browsers (bound classes get passed down to component root element)

@@ -8,6 +8,15 @@ var empty = {}
var identRE = require('../parsers/path').identRE
var settablePathRE = /^[A-Za-z_$][\w$]*(\.[A-Za-z_$][\w$]*|\[[^\[\]]+\])*$/

// feature detect browsers (IE) that have trouble
// with binding syntax on certain attributes
var div, preferBinding
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move this check in to util/env.js and expose it as _.preferBinding.

@fergaldoyle
Copy link
Contributor Author

hasAttribute now used and indeed there is no need to check for .once or .sync

yyx990803 added a commit that referenced this pull request Nov 4, 2015
IE should prefer bound props over static props other than class
@yyx990803 yyx990803 merged commit 474da3d into vuejs:dev Nov 4, 2015
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

Successfully merging this pull request may close these issues.

2 participants