Skip to content

Commit 46e38f0

Browse files
committed
fix attrs sort mode
1 parent 839383d commit 46e38f0

File tree

5 files changed

+940
-933
lines changed

5 files changed

+940
-933
lines changed

dist/regular.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4053,8 +4053,9 @@ return /******/ (function(modules) { // webpackBootstrap
40534053
var context = this;
40544054
var handles = context._handles || (context._handles = {}),
40554055
calls = handles[event] || (handles[event] = []);
4056+
var realFn;
40564057
if(desc.once){
4057-
var realFn = function(){
4058+
realFn = function(){
40584059
fn.apply( this, arguments )
40594060
this.$off(event, fn);
40604061
}
@@ -5322,7 +5323,7 @@ return /******/ (function(modules) { // webpackBootstrap
53225323
}
53235324

53245325
if(lazy){
5325-
elem.addEventListener("change", handler );
5326+
dom.on(elem, 'change', handler)
53265327
}else{
53275328
if( hasInput){
53285329
elem.addEventListener("input", handler );

dist/regular.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/directive/form.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,11 @@ function initText(elem, parsed, extra){
122122
}
123123

124124
if(hasInput === undefined){
125-
hasInput = dom.msie !== 9 && "oninput" in dom.tNode;
125+
hasInput = dom.msie !== 9 && "oninput" in document.createElement('input')
126126
}
127127

128128
if(lazy){
129-
elem.addEventListener("change", handler );
129+
dom.on(elem, 'change', handler)
130130
}else{
131131
if( hasInput){
132132
elem.addEventListener("input", handler );
@@ -138,8 +138,8 @@ function initText(elem, parsed, extra){
138138
parsed.set(self, elem.value);
139139
}
140140
return function (){
141-
if(lazy) return elem.removeEventListener("change", handler);
142-
if(dom.msie !== 9 && "oninput" in dom.tNode ){
141+
if(lazy) return dom.off(elem, "change", handler);
142+
if( hasInput ){
143143
elem.removeEventListener("input", handler );
144144
}else{
145145
dom.off(elem, "paste keyup cut change", handler)

src/util.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ var entities = require('./helper/entities.js');
77
var slice = [].slice;
88
var o2str = ({}).toString;
99
var win = typeof window !=='undefined'? window: global;
10+
var MAX_PRIORITY = 9999;
1011

1112

1213
_.noop = function(){};
@@ -465,6 +466,10 @@ _.fixTagAST = function( tagAST, Component ){
465466

466467
var attr = attrs[ len ];
467468

469+
470+
// @IE fix IE9- input type can't assign after value
471+
if(attr.name === 'type') attr.priority = MAX_PRIORITY+1;
472+
468473
var directive = Component.directive( attr.name );
469474
if( directive ) {
470475

@@ -494,14 +499,12 @@ _.fixTagAST = function( tagAST, Component ){
494499
});
495500

496501
attrs.sort(function(a1, a2){
497-
// fix IE9- input type can't assign after value
498-
if(a2.name === "type") return 1;
499-
502+
500503
var p1 = a1.priority;
501504
var p2 = a2.priority;
502505

503-
if(p1 == null) p1 = 10000;
504-
if(p2 == null) p2 = 10000;
506+
if( p1 == null ) p1 = MAX_PRIORITY;
507+
if( p2 == null ) p2 = MAX_PRIORITY;
505508

506509
return p2 - p1;
507510

0 commit comments

Comments
 (0)