@@ -22,7 +22,7 @@ const RIPPLECHECK: string = 'e-ripple-check';
22
22
const RIPPLEINDETERMINATE : string = 'e-ripple-stop' ;
23
23
const RTL : string = 'e-rtl' ;
24
24
const WRAPPER : string = 'e-checkbox-wrapper' ;
25
- const containerAttr : string [ ] = [ 'title' , 'class' , 'style' , 'disabled' , 'readonly' , 'name' , 'value' , 'id' , 'tabindex' , 'aria-label' ] ;
25
+ const containerAttr : string [ ] = [ 'title' , 'class' , 'style' , 'disabled' , 'readonly' , 'name' , 'value' , 'id' , 'tabindex' , 'aria-label' , 'required' ] ;
26
26
27
27
/**
28
28
* The CheckBox is a graphical user interface element that allows you to select one or more options from the choices.
@@ -165,7 +165,7 @@ export class CheckBox extends Component<HTMLInputElement> implements INotifyProp
165
165
super ( options , < string | HTMLInputElement > element ) ;
166
166
}
167
167
168
- private changeState ( state ?: string , isInitialize ?: boolean ) : void {
168
+ private changeState ( state ?: string , isInitialize ?: boolean , isInterAction ?: boolean ) : void {
169
169
const wrapper : Element = this . getWrapper ( ) as Element ;
170
170
let rippleSpan : Element | null = null ;
171
171
let frameSpan : Element | null = null ;
@@ -185,7 +185,7 @@ export class CheckBox extends Component<HTMLInputElement> implements INotifyProp
185
185
rippleSpan . classList . add ( RIPPLECHECK ) ;
186
186
}
187
187
this . element . checked = true ;
188
- if ( ( this . element . required || closest ( this . element , 'form' ) && closest ( this . element , 'form' ) . classList . contains ( 'e-formvalidator' ) ) && this . validCheck && ! isInitialize ) {
188
+ if ( ( this . element . required || closest ( this . element , 'form' ) && closest ( this . element , 'form' ) . classList . contains ( 'e-formvalidator' ) ) && this . validCheck && ! isInitialize && isInterAction ) {
189
189
this . element . checked = false ;
190
190
this . validCheck = false ;
191
191
} else if ( this . element . required || closest ( this . element , 'form' ) && closest ( this . element , 'form' ) . classList . contains ( 'e-formvalidator' ) ) {
@@ -199,7 +199,7 @@ export class CheckBox extends Component<HTMLInputElement> implements INotifyProp
199
199
removeClass ( [ rippleSpan ] , [ RIPPLECHECK , RIPPLEINDETERMINATE ] ) ;
200
200
}
201
201
this . element . checked = false ;
202
- if ( ( this . element . required || closest ( this . element , 'form' ) && closest ( this . element , 'form' ) . classList . contains ( 'e-formvalidator' ) ) && this . validCheck && ! isInitialize ) {
202
+ if ( ( this . element . required || closest ( this . element , 'form' ) && closest ( this . element , 'form' ) . classList . contains ( 'e-formvalidator' ) ) && this . validCheck && ! isInitialize && isInterAction ) {
203
203
this . element . checked = true ;
204
204
this . validCheck = false ;
205
205
} else if ( this . element . required || closest ( this . element , 'form' ) && closest ( this . element , 'form' ) . classList . contains ( 'e-formvalidator' ) ) {
@@ -221,9 +221,6 @@ export class CheckBox extends Component<HTMLInputElement> implements INotifyProp
221
221
222
222
private clickHandler ( event : Event ) : void {
223
223
if ( ( event . target as HTMLElement ) . tagName === 'INPUT' && this . clickTriggered ) {
224
- if ( this . isVue ) {
225
- this . changeState ( this . checked ? 'check' : 'uncheck' ) ;
226
- }
227
224
this . clickTriggered = false ;
228
225
return ;
229
226
}
@@ -236,14 +233,14 @@ export class CheckBox extends Component<HTMLInputElement> implements INotifyProp
236
233
this . isMouseClick = false ;
237
234
}
238
235
if ( this . indeterminate ) {
239
- this . changeState ( this . checked ? 'check' : 'uncheck' ) ;
236
+ this . changeState ( this . checked ? 'check' : 'uncheck' , false , true ) ;
240
237
this . indeterminate = false ;
241
238
this . element . indeterminate = false ;
242
239
} else if ( this . checked ) {
243
- this . changeState ( 'uncheck' ) ;
240
+ this . changeState ( 'uncheck' , false , true ) ;
244
241
this . checked = false ;
245
242
} else {
246
- this . changeState ( 'check' ) ;
243
+ this . changeState ( 'check' , false , true ) ;
247
244
this . checked = true ;
248
245
}
249
246
const changeEventArgs : ChangeEventArgs = { checked : this . updateVueArrayModel ( false ) , event : event } ;
0 commit comments