mirror of
https://github.com/jquery/jquery.git
synced 2026-04-20 03:01:22 -04:00
Fix #11316. Find valHooks first by element type, then by nodeName.
Reverses the previous search order.
This commit is contained in:
committed by
Dave Methvin
parent
f0732c1e41
commit
2803a5e6f2
@@ -162,7 +162,7 @@ jQuery.fn.extend({
|
||||
|
||||
if ( !arguments.length ) {
|
||||
if ( elem ) {
|
||||
hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ];
|
||||
hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
|
||||
|
||||
if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
|
||||
return ret;
|
||||
@@ -206,7 +206,7 @@ jQuery.fn.extend({
|
||||
});
|
||||
}
|
||||
|
||||
hooks = jQuery.valHooks[ this.nodeName.toLowerCase() ] || jQuery.valHooks[ this.type ];
|
||||
hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
|
||||
|
||||
// If set returns undefined, fall back to normal setting
|
||||
if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
|
||||
|
||||
Reference in New Issue
Block a user