#17421 closed defect (bug) (fixed)
Static page selection is disabled in Reading Settings ( jQuery v1.6.1 issue )
Reported by: | rossdev | Owned by: | |
---|---|---|---|
Milestone: | 3.2 | Priority: | normal |
Severity: | major | Version: | 3.2 |
Component: | UI | Keywords: | has-patch |
Focuses: | Cc: |
Description
When trying to select a static page the selection is under-intensified. When viewing source the options are listed but <select> is set as disabled.
Attachments (3)
Change History (14)
#2
@
14 years ago
Found the problem, and it's with jQuery v1.6.1
The issue goes away when jQuery v1.4.4 is loaded.
#3
@
14 years ago
- Summary changed from Static page selection is disabled in Reading Settings to Static page selection is disabled in Reading Settings ( jQuery v1.6.1 issue )
#4
@
14 years ago
- Keywords has-patch added
Sorry, the patch somehow got added twice. They are the same. I have tested this patch in FF 3.6, FF 4, IE 8, IE 9, Opera 10, Opera 11, Safari 5, and Chrome 10. Changing .attr to .prop allows the dropdown boxes to work correctly again.
#5
follow-up:
↓ 7
@
14 years ago
- Milestone changed from Awaiting Review to 3.2
Didn't realise that a patch was attached when I wrote mine, because I did I thought I would upload it anyway. Also changes the staticPage check to use .prop().
I thought 1.6.1 was supposed to make this kind of use of .attr() work again. Should probably report upstream if it hasn't been done so already.
#7
in reply to:
↑ 5
@
13 years ago
Replying to duck_:
I thought 1.6.1 was supposed to make this kind of use of .attr() work again. Should probably report upstream if it hasn't been done so already.
Yes, that would be a good idea. You will need to make a small test case for it.
#8
follow-up:
↓ 10
@
13 years ago
IIRC is:checked should work fine. The potential bug upstream is an interesting one.
#9
@
13 years ago
All it took for me to get things working as intended was changing .attr to .prop, in other words from this
selects.attr('disabled', staticPage.is(':checked') ? '' : 'disabled');
to this
selects.prop('disabled', staticPage.is(':checked') ? '' : 'disabled');
I assume the additional code change duck_ did is just as valid, but it wasn't necessary to make the drop down boxes work.
#10
in reply to:
↑ 8
@
13 years ago
Replying to nacin:
IIRC is:checked should work fine.
Correct. As JDTrower says it was unnecessary for that actual bug fix. The reason for the change was because the jQuery 1.6 release post indicated that .prop() is faster than and preferred to the is:checked method. Sorry, I should've made the reasoning clearer in the comment above.
#11
@
13 years ago
@nacin, @JDTrower yes, staticPage.is(':checked')
would work too but as @duck_ mentions .prop()
is preferred with jQuery 1.6. Also the
? '' : 'disabled'
bit is not needed any more (think at one point you needed to pass an empty string to .attr()
in order to remove an attribute with jQuery).
Looks like a javascript error.