#6796 closed bug (fixed)
jQueryui - buttonset on rtl
Reported by: | oferwald | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.8.14 |
Component: | ui.button | Version: | 1.8.7 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description (last modified by )
If you attempt using a buttonset on a document or element which has dir="rtl" the wrong corners will be selected
Just add <html dir="rtl"> to the existing demo pages to see the problem.
Change History (13)
comment:1 Changed 12 years ago by
Description: | modified (diff) |
---|---|
Status: | new → open |
comment:2 Changed 12 years ago by
Description: | modified (diff) |
---|
comment:3 Changed 12 years ago by
comment:4 Changed 12 years ago by
I can confirm the fix ;) thanks. How about setting the milestone to 1.8.xx?
comment:5 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | open → closed |
Merge pull request #257 from dcneiner/buttonset-rtl
Fixed #6796
Changeset: 523790b111558d88b83d23e5b3f5c65a58b7dae5
comment:6 Changed 12 years ago by
Button: Added rtl detection so corner classes would properly be applied to buttonsets. Fixed #6796. jQueryui - buttonset on rtl (cherry picked from commit 50a4186ef949ecaf7ab4977048160820587218d2)
Changeset: 15cb56726f8b05be40dd7dc6590cef017cd8e953
comment:7 Changed 12 years ago by
Milestone: | 1.9 → 1.8.14 |
---|
comment:8 follow-up: 10 Changed 12 years ago by
I'd just like to point out a small problem with this patch. It seems in Chrome that when calling .css('direction') on an element not added to the DOM, nothing is returned. So when calling buttonset on an element and then adding it to the DOM, the rounded corners are on the wrong side.
Should I only be calling buttonset on elements already in the DOM? Or is this a bug in jQuery?
comment:10 follow-up: 11 Changed 12 years ago by
Replying to lee.b:
I'd just like to point out a small problem with this patch. It seems in Chrome that when calling .css('direction') on an element not added to the DOM, nothing is returned. So when calling buttonset on an element and then adding it to the DOM, the rounded corners are on the wrong side.
Should I only be calling buttonset on elements already in the DOM? Or is this a bug in jQuery?
Chrome reports the direction just fine. You're probably relying on rules defined in stylesheets to set the direction (which aren't applied because your element isn't in the DOM). Also, your test case doesn't show anything with direction.
comment:11 Changed 12 years ago by
Replying to scott.gonzalez:
Replying to lee.b:
I'd just like to point out a small problem with this patch. It seems in Chrome that when calling .css('direction') on an element not added to the DOM, nothing is returned. So when calling buttonset on an element and then adding it to the DOM, the rounded corners are on the wrong side.
Should I only be calling buttonset on elements already in the DOM? Or is this a bug in jQuery?
Chrome reports the direction just fine. You're probably relying on rules defined in stylesheets to set the direction (which aren't applied because your element isn't in the DOM). Also, your test case doesn't show anything with direction.
Inspect the labels; test1 has a class of ui-corner-right and test2 has a class of ui-corner-left.
comment:12 follow-up: 13 Changed 12 years ago by
comment:13 Changed 12 years ago by
Replying to lee.b:
jQuery 1.6.2 + jQuery UI 1.8.14 compared to jQuery 1.5.2 + jQuery UI 1.8.9
Sorry, I thought you were referring to buttons that were RTL but disconnected. I've created #7697 to track this. Thanks.
Fix provided here: https://github.com/jquery/jquery-ui/pull/257 (Unit test included)
Demo of fix here: http://jsbin.com/arubu5/5