Skip to content

Commit 1549966

Browse files
committed
add focus to more controls
1 parent 3d2152a commit 1549966

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

lib/glow/primitives.js

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3007,6 +3007,9 @@
30073007
attrs.aria_label = value
30083008
$(attrs.jradio).attr('aria-label', value)
30093009
},
3010+
focus: function() {
3011+
$(attrs.jradio).focus()
3012+
},
30103013
remove: function() {
30113014
let rb = __radio_buttons
30123015
let name = attrs.name
@@ -3102,6 +3105,9 @@
31023105
attrs.aria_label = value
31033106
$(attrs.jcheckbox).attr('aria-label', value)
31043107
},
3108+
focus: function() {
3109+
$(attrs.jcheckbox).focus()
3110+
},
31053111
remove: function() {
31063112
$(attrs.jcheckbox).remove()
31073113
$("#"+attrs._id).remove()
@@ -3264,7 +3270,9 @@
32643270
attrs.aria_label = value
32653271
$(attrs.jwinput).attr('aria-label', value)
32663272
},
3267-
3273+
focus: function() {
3274+
$(attrs.jwinput).focus()
3275+
},
32683276
get number() {return attrs.number},
32693277
remove: function() {
32703278
if (attrs.prompt != '') attrs.__wprompt.remove()
@@ -3331,9 +3339,6 @@
33313339
attrs.background = value
33323340
$(attrs.jbutton).css({backgroundColor:rgb_to_css(attrs.background)})
33333341
},
3334-
focus: function() {
3335-
$(attrs.jbutton).focus()
3336-
},
33373342
get aria_labelledby() {return attrs.aria_labelledby},
33383343
set aria_labelledby(value) {
33393344
if (value._id === undefined) throw new Error("An aria_labelledby attribute must be a wtext object.")
@@ -3351,6 +3356,9 @@
33513356
attrs.aria_label = value
33523357
$(attrs.jbutton).attr('aria-label', value)
33533358
},
3359+
focus: function() {
3360+
$(attrs.jbutton).focus()
3361+
},
33543362
remove: function() {
33553363
attrs.disabled = true
33563364
$(attrs.jbutton).attr('disabled', attrs.disabled)
@@ -3516,7 +3524,9 @@
35163524
attrs.aria_label = value
35173525
$(attrs.jslider).attr('aria-label', value)
35183526
},
3519-
3527+
focus: function() {
3528+
$(attrs.jslider).focus()
3529+
},
35203530
remove: function() {
35213531
attrs.disabled = true
35223532
$(attrs.jslider).attr('disabled', attrs.disabled)
@@ -3613,7 +3623,9 @@
36133623
attrs.aria_label = value
36143624
$(attrs.jmenu).attr('aria-label', value)
36153625
},
3616-
3626+
focus: function() {
3627+
$(attrs.jmenu).focus()
3628+
},
36173629
remove: function() {
36183630
attrs.disabled = true
36193631
$(attrs.jmenu).attr('disabled', attrs.disabled)

0 commit comments

Comments
 (0)