-   Notifications  You must be signed in to change notification settings 
- Fork 5.3k
Selectmenu #866
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Selectmenu #866
Changes from 1 commit
f2228b0 156d0fb e299e9a cea6844 b1a72e6 72c17f0 8c10c1e b4d9eee 94f8514 682a321 e38feea 4a9e26c 1092551 ec5f2ae 41dfb09 c6a8d7e 31a38e9 8fbdd7c eae21ff b348d32 ddf7c27 360e885 4460376 ff957dd c5a449d c3f6bd9 ec6d88f b30184d 7345e43 37a8047 d4ec5cb 8abe1d0 749c8fb 39532f0 5092d02 8f5f4b3 b19986a 001bd3d c7e9906 44f9b8f 83f4249 06372cd 549b97e dd272e7 b6e2467 c179902 daadc84 66156aa fb87e1c 5e12c54 cca4e77 fc729a8 c59fbba 20d19db 8e1e956 99aa0ff 86f4c2f e059376 b8cce0c 9cf0f21 b2d50f9 e7e73ce 7c1a9d9 a59b3c7 228a9b9 b6e1c86 684b55b 7725e4a a9a6e3b 94b3a65 7ce8e05 12fe28f 0734314 967e2b7 daec559 2bb459f 4160978 b7ee7b2 d24e62b 8cbbf33 f86168b dff9917 a2d3ef3 dec8399 0d4a8dc e25cdd8 709f75b 4e68c52 36533a7 7328333 8a62210 b014bc6 080b5bc 71e744a e581a13 a177a92 1e6808a ac7b8f9 f622428 18ecaf4 d1c9837 6fd9d8f 0d28263 04553a7 cba09da 60e3302 40b8567 aa60a9e e6aca63 7a05c65 15032d1 2845d38 d1350f9 f6372bd 0732835 20aad07 812a90f b15ae2a ed422bd 8901960 c69d01b 1ea2256 21e46b8 e2b5123 25023c3 8aa24dd 57ecee8 930e9d5 ae68ab8 58f2706 1b1dbd8 76f335e 1afede8 52fc8e3 2ab514f a787d52 8462194 50d7a96 dab7bf8 44e472a 2eb9223 1ba02e9 c960285 f244108 fb47fd0 dcb28a7 4d77ca3 f5e65b0 de149c4 91dde04 3a17a91 9719719 110cab1 b81bb0b a7b4f29 78f9362 fdf3af6 75cfcf2 640d308 8a5e869 06eb3bf 50bb89f f434271 d599bf9 d94e217 dffe8f6 8787cb0 890881d f08b0af f128292 6e80a19 022079a 8fc08a1 66ba390 6acc6bd 0bf91a4 a7ea386 775b81b 2f7bd63 a6e2863 e2235bd 5a9a80f 1ce8d87 ba0e804 26c528a 73c7342 4efd006 e1590c4 c0fa69d 026f517 4d986a4 c73f7e8 8b6c81e 1fa8c20 f2bd236 1cca829 0d7b25d d66528b c1667ba ad30163 0264f07 60eed79 a29cfb8 68c7485 b84cd7e 8b4a304 00ab497 5e9ad9b 0631d76 ee9c443 17b6ff7 d4f13bc 666927b b8339eb 4c930fd 70a4360 61be0e5 f96ee5e 6640925 7715c71 255d4f6 5e06985 adcfa63 ef8c792 1c878ce 97cca1e ddf1347 cb5f9bb 83e795f 7e0737e cccb8c6 29f726c a572f72 dfbd712 84ee9d8 e7d200f 7be7d96 bfd3c4a 57fa482 33317c9 1821517 ab48ae7 ffc7d31 ab72fd1 9992d46 b735152 2c9f5a8 ff1bb14 3483b94 b9fa8f7 File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
|  | @@ -73,6 +73,10 @@ $.widget( "ui.selectmenu", { | |
|  | ||
| _drawButton: function() { | ||
| var tabindex = this.element.attr( 'tabindex' ); | ||
| var labelSelector = "label[for='" + this.element.attr("id") + "']"; | ||
|  | ||
| // Find existing label | ||
| this.labelElement = $( labelSelector ).uniqueId(); | ||
|  | ||
| // hide original select tag | ||
| this.element.hide(); | ||
|  | @@ -85,6 +89,7 @@ $.widget( "ui.selectmenu", { | |
| id: this.ids.button, | ||
| width: this.element.outerWidth(), | ||
| role: 'combobox', | ||
| 'aria-labelledby': this.labelElement.attr("id"), | ||
| 'aria-expanded': false, | ||
| 'aria-autocomplete': 'list', | ||
| 'aria-owns': this.ids.menu, | ||
|  | @@ -150,6 +155,10 @@ $.widget( "ui.selectmenu", { | |
| } | ||
| } | ||
| that.focus = item.index; | ||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 
 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Renamed to focusIndex. | ||
|  | ||
| // Set ARIA active decendent | ||
| that.button.attr( "aria-activedescendant", item.element.uniqueId().attr( "id" ) ); | ||
|  | ||
| }, | ||
| // set ARIA role | ||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Comments like this aren't useful. It exactly duplicate the code. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done! | ||
| role: 'listbox' | ||
|  | @@ -330,6 +339,9 @@ $.widget( "ui.selectmenu", { | |
| this._move( "next", event ); | ||
| } | ||
| break; | ||
| case $.ui.keyCode.SPACE: | ||
| this._toggle( event ); | ||
| break; | ||
| case $.ui.keyCode.LEFT: | ||
| this._move( "previous", event ); | ||
| break; | ||
|  | @@ -372,6 +384,7 @@ $.widget( "ui.selectmenu", { | |
| // change ARIA attr | ||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove comment. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done! | ||
| this.menuItems.find( "a" ).attr( "aria-selected", false ); | ||
| this._getSelectedItem().find( "a" ).attr( "aria-selected", true ); | ||
| this.button.attr( "aria-activedescendant", item.element.uniqueId().attr( "id" ) ); | ||
| }, | ||
|  | ||
| _setOption: function( key, value ) { | ||
|  | @@ -427,6 +440,7 @@ $.widget( "ui.selectmenu", { | |
| this.menuWrap.remove(); | ||
| this.buttonWrap.remove(); | ||
| this.element.show(); | ||
| this.labelElement.removeUniqueId(); | ||
| } | ||
| }); | ||
|  | ||
|  | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments start with an uppercase letter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done for all comments.