@@ -22,7 +22,7 @@ const RIPPLECHECK: string = 'e-ripple-check';
2222const RIPPLEINDETERMINATE : string = 'e-ripple-stop' ;
2323const RTL : string = 'e-rtl' ;
2424const 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' ] ;
2626
2727/**
2828 * 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
165165 super ( options , < string | HTMLInputElement > element ) ;
166166 }
167167
168- private changeState ( state ?: string , isInitialize ?: boolean ) : void {
168+ private changeState ( state ?: string , isInitialize ?: boolean , isInterAction ?: boolean ) : void {
169169 const wrapper : Element = this . getWrapper ( ) as Element ;
170170 let rippleSpan : Element | null = null ;
171171 let frameSpan : Element | null = null ;
@@ -185,7 +185,7 @@ export class CheckBox extends Component<HTMLInputElement> implements INotifyProp
185185 rippleSpan . classList . add ( RIPPLECHECK ) ;
186186 }
187187 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 ) {
189189 this . element . checked = false ;
190190 this . validCheck = false ;
191191 } 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
199199 removeClass ( [ rippleSpan ] , [ RIPPLECHECK , RIPPLEINDETERMINATE ] ) ;
200200 }
201201 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 ) {
203203 this . element . checked = true ;
204204 this . validCheck = false ;
205205 } 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
221221
222222 private clickHandler ( event : Event ) : void {
223223 if ( ( event . target as HTMLElement ) . tagName === 'INPUT' && this . clickTriggered ) {
224- if ( this . isVue ) {
225- this . changeState ( this . checked ? 'check' : 'uncheck' ) ;
226- }
227224 this . clickTriggered = false ;
228225 return ;
229226 }
@@ -236,14 +233,14 @@ export class CheckBox extends Component<HTMLInputElement> implements INotifyProp
236233 this . isMouseClick = false ;
237234 }
238235 if ( this . indeterminate ) {
239- this . changeState ( this . checked ? 'check' : 'uncheck' ) ;
236+ this . changeState ( this . checked ? 'check' : 'uncheck' , false , true ) ;
240237 this . indeterminate = false ;
241238 this . element . indeterminate = false ;
242239 } else if ( this . checked ) {
243- this . changeState ( 'uncheck' ) ;
240+ this . changeState ( 'uncheck' , false , true ) ;
244241 this . checked = false ;
245242 } else {
246- this . changeState ( 'check' ) ;
243+ this . changeState ( 'check' , false , true ) ;
247244 this . checked = true ;
248245 }
249246 const changeEventArgs : ChangeEventArgs = { checked : this . updateVueArrayModel ( false ) , event : event } ;
0 commit comments