Telerik Forums
Kendo UI for Angular Forum
0 answers
19 views

Is it possible to have different Switch fill colors in different components?  I can't turn off View encapsulation.

 

I have tried:


::ng-deep .k-switch-on .k-switch-track {
  border-color: red !important;
  background-color: red !important;
}

 

in the component .scss file but it doesn't work.

Mike
Top achievements
Rank 1
 asked on 02 Apr 2024
0 answers
81 views

I'm struggling to access this kendo-switch ID (in this case it should be A1) being passed to the generateSubscriptionArray function it seems to return undefined no matter what variation of attempts to access it I try, it also doesn't seem to show up on the $event if I try to pass this to the function.

Any assistance regarding this would be really beneficial the switch is returning the relevant true/false boolean

HTML

 

<kendo-switch onLabel=" " offLabel=" " formControlName="A1" id="A1" (click)="generateSubscriptionArray(userPreferenceForm.controls.A1.value,
formcontrol id as string in this case A1 should be passed here)" ></kendo-switch>


TypeScript:

exportclass UserPreferencesComponent implements OnInit { userPreferenceForm: FormGroup; email_address: FormControl; constructor() {} ngOnInit(): void { this.userPreferenceForm = new FormGroup({ email_address: new FormControl('', Validators.required), A1: new FormControl(false), }); }

generateSubscriptionArray = (subscription: boolean, alertID: string): void => { if (subscription === true) { console.log(subscription, alertID); } else { console.log(subscription, alertID); } };


Olivia
Top achievements
Rank 1
 asked on 03 Mar 2023
1 answer
117 views

When using the Fluent theme, I would expect the colour of a disabled switch to be a lighter version of the colour for the normal on state, but it's grey, so not easily to tell the difference in the switch state between on and off.

Using the normal theme;

 

Using the fluent theme

 

Yanmario
Telerik team
 answered on 28 Sep 2022
0 answers
37 views

Hi,

I have grid and in every row i have a switch button .

I have a requirement to set ARIA LABEL value dynamically so that the user will know which column and row he is in. While fixing that, I found the JAWS screen reader reading additional comments(colored yellow) other than the content from ARIA LABEL. I am unable to find where it is coming from. This happens only for the first row. Also, the screen reader reads the column header for the second time. Please find the JAWS Speech history below. Attached is the screenshot of the same.

Yes/No
column 5 row 2
Column 5 row 1 Contains Controls 
Column 5 row 1 Switch Off 
Yes/No //It reads Column Header for the second time
column 4 row 1    //Additional content
Switch Pressed On 
Column 5 row 2 Switch Off 
Switch Pressed On 
Column 5 row 3 Switch Off 
Switch Pressed On 
Column 5 row 4 Switch Off 
Switch Pressed On 
Column 5 row 5 Switch Off 
Switch Pressed On


How to solve this?

Here's the stackblitz link:  https://stackblitz.com/edit/angular-egapar?file=src%2Fapp%2Fapp.component.ts

Thanks,

Sowmiya

Sowmiya
Top achievements
Rank 1
 asked on 10 May 2022
0 answers
187 views

Hi,

I have a kendo grid and in each row, I have a kendo switch button. When focusing on the kendo switch in the first row, the JAWS screen reader reads the entire grid values. The expected behavior is JAWS should read only the aria-label value along with Switch's action(Switched on or Pressed Off). I tried setting role="switch" and role="button".  How to fix this?

Here's the stackblitz link:  https://stackblitz.com/edit/angular-egapar?file=src%2Fapp%2Fapp.component.ts

I've attached JAWS' Speech history.

 

Thanks

Sowmiya
Top achievements
Rank 1
 updated question on 22 Apr 2022
0 answers
630 views

I am creating unit tests using jest and I can't run the test because of Angular not like "on" inside the [onLabel] attribute in kendo-switch.  Is there a work around for this?  

 

Template parse errors:
    Binding to event property 'onLabel' is disallowed for security reasons, please use (Label)=...
    If 'onLabel' is a directive input, make sure the directive is imported by the current module. ("
              (valueChange)="switchPageSize($event)"
              [offLabel]="'All'"
              [ERROR ->][onLabel]="'All'">
            </kendo-switch>
          </ng-template>
    "): ng:///DynamicTestModule/HistoryComponent.html@199:10

wil
Top achievements
Rank 1
 asked on 11 Nov 2020
3 answers
279 views
I have a switch and I want to confirm with the user that they want to perform the action. Is there any way to return false and have the switch not change if the user clicks cancel?
Hetali
Telerik team
 answered on 22 Jun 2020
1 answer
142 views

Hello Angular Kendo UI Team,

I think I might have found a bug. On the attached screenshot I show that as a table cell is in edit mode, elements in other columns rerender, e.g. SwitchComponent and possibly due to css class conflict the said component is stretched (just while in edit mode of another cell)

Cheers, K. Dimitrov

Svet
Telerik team
 answered on 23 May 2019
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?