select.val(newValue) doesn't work in IE10 if option contents have leading/trailing spaces #1902

Closed
mgol opened this Issue Dec 4, 2014 · 2 comments

Comments

Projects
None yet
2 participants
@mgol
Member

mgol commented Dec 4, 2014

Example:

jQuery( "<select><option> 2</option></select>" ).val( "2" ).val()

should return "2" and it doesn't in IE10.

@mgol

This comment has been minimized.

Show comment
Hide comment
@mgol

mgol Dec 4, 2014

Member

This is caused by the fact that the select set valHook is reading option.value without going through the option get valHook.

Member

mgol commented Dec 4, 2014

This is caused by the fact that the select set valHook is reading option.value without going through the option get valHook.

mgol added a commit to mgol/jquery that referenced this issue Dec 4, 2014

Attributes: Use the option val hook in select val hook and simplify it
The hook is still defined; not using it could cause issues in IE<11.
Also, IE10 no longer throws when value not set but it still doesn't trim the
value. IE11 has all those issues fixed; support comments are updated.

Fixes gh-1902
Closes gh-1901
@mgol

This comment has been minimized.

Show comment
Hide comment
@mgol

mgol Dec 4, 2014

Member

PR: #1901

Member

mgol commented Dec 4, 2014

PR: #1901

mgol added a commit to mgol/jquery that referenced this issue Dec 8, 2014

Attributes: Use the option val hook in select val hook and simplify it
The hook is still defined; not using it could cause issues in IE<11.
Also, IE10 no longer throws when value not set but it still doesn't trim the
value. IE11 has all those issues fixed; support comments are updated.

Fixes gh-1902
Closes gh-1901

@mgol mgol closed this in #1901 Dec 8, 2014

mgol added a commit that referenced this issue Dec 8, 2014

Attributes: Simplify the option val hook; backport a test from master
The hook is still defined; not using it could cause issues in IE<11.
Backport the test from the master branch.

Also, IE10 no longer throws when value not set but it still doesn't trim the
value. IE11 has all those issues fixed; support comments are updated.

(cherry-picked from f6302b0)

Fixes gh-1902
Closes gh-1901

@mgol mgol added this to the 3.0.0 milestone Oct 17, 2015

mgol added a commit that referenced this issue Nov 10, 2015

Attributes: Use the option val hook in select val hook and simplify it
The hook is still defined; not using it could cause issues in IE<11.
Also, IE10 no longer throws when value not set but it still doesn't trim the
value. IE11 has all those issues fixed; support comments are updated.

Fixes gh-1902
Closes gh-1901

@dmethvin dmethvin modified the milestones: 1.12/2.2, 3.0.0 Jan 7, 2016

@cssmagic cssmagic referenced this issue in cssmagic/ChangeLog May 18, 2016

Open

jQuery #5

@jquery jquery locked as resolved and limited conversation to collaborators Jun 19, 2018

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