@@ -35,11 +35,11 @@ export class HXCheckboxElement extends HXElement {
3535 this . $upgradeProperty ( 'checked' ) ;
3636 this . $upgradeProperty ( 'disabled' ) ;
3737 this . $upgradeProperty ( 'indeterminate' ) ;
38- this . _input . addEventListener ( 'change' , this . _onChange ) ;
38+ this . _chkInput . addEventListener ( 'change' , this . _onChange ) ;
3939 }
4040
4141 $onDisconnect ( ) {
42- this . _input . removeEventListener ( 'change' , this . _onChange ) ;
42+ this . _chkInput . removeEventListener ( 'change' , this . _onChange ) ;
4343 }
4444
4545 static get $observedAttributes ( ) {
@@ -54,15 +54,15 @@ export class HXCheckboxElement extends HXElement {
5454 const hasValue = ( newVal !== null ) ;
5555 switch ( attr ) {
5656 case 'indeterminate' :
57- this . _input . indeterminate = hasValue ;
57+ this . _chkInput . indeterminate = hasValue ;
5858 break ;
5959 case 'checked' :
60- if ( this . _input . checked !== hasValue ) {
61- this . _input . checked = hasValue ;
60+ if ( this . _chkInput . checked !== hasValue ) {
61+ this . _chkInput . checked = hasValue ;
6262 }
6363 break ;
6464 case 'disabled' :
65- this . _input . disabled = hasValue ;
65+ this . _chkInput . disabled = hasValue ;
6666 break ;
6767 }
6868 }
@@ -99,6 +99,13 @@ export class HXCheckboxElement extends HXElement {
9999 }
100100 }
101101
102+ /**
103+ * Pass-through function to native input.
104+ */
105+ click ( ) {
106+ this . _chkInput . click ( ) ;
107+ }
108+
102109 /** @private */
103110 _onChange ( evt ) {
104111 // Update internal state
@@ -112,7 +119,7 @@ export class HXCheckboxElement extends HXElement {
112119 }
113120
114121 /** @private */
115- get _input ( ) {
122+ get _chkInput ( ) {
116123 return this . shadowRoot . getElementById ( 'hxNativeControl' ) ;
117124 }
118125}
0 commit comments