Weird inputSwitch with no handle

Forum rules
Please note that response time for technical support is within 3-5 business days.
Post Reply
johnhoang
Posts: 13
Joined: 12 Apr 2017, 22:39

09 Aug 2018, 21:37

Hi,

I am having a problem using p-inputSwitch. It seems getting rendered differently without the handle.

Using in control template as:

Code: Select all

<p-inputSwitch name="measureUnit" [(ngModel)]="selectedItem.measureUnit" (onChange)="onUnitChanged($event)"></p-inputSwitch>
What I got in rendered html:

Code: Select all

<p-inputswitch name="measureUnit" ng-reflect-name="measureUnit" ng-reflect-model="true" class="ng-valid ng-dirty ng-touched">
  <div role="checkbox" class="ui-inputswitch ui-widget ui-inputswitch-checked" ng-reflect-ng-class="[object Object]" aria-checked="true">
    <div class="ui-helper-hidden-accessible">
      <input type="checkbox" name="measureUnit">
    </div>
    <span class="ui-inputswitch-slider"></span>
  </div>
</p-inputswitch>
It should be rendered similar to:

Code: Select all

<p-inputswitch class="ng-valid ng-dirty ng-touched">
  <div class="ui-inputswitch ui-widget ui-widget-content ui-corner-all ui-inputswitch-checked" style="width: 45px;">
    <div class="ui-inputswitch-off" style="width: 29px;">
      <span class="ui-inputswitch-offlabel" style="width: 25px; margin-right: -14px;">Off</span>
    </div>
    <div class="ui-inputswitch-on" style="width: 14px;">
      <span class="ui-inputswitch-onlabel" style="width: 25px; margin-left: 0px;">On</span>
    </div>
    <div class="ui-inputswitch-handle ui-state-default" style="width: 19px; left: 14px;"></div>
    <div class="ui-helper-hidden-accessible">
      <input aria-live="polite" readonly="readonly" type="checkbox" aria-label="InputSwitch On">
    </div>
  </div>
</p-inputswitch>
This does not happen with Ultima 5.2.4, PrimeNg 5, Angular 5 but with Ultima 6, Angular 6 and primeng 6. Any one know why?

Thanks.

johnhoang
Posts: 13
Joined: 12 Apr 2017, 22:39

09 Aug 2018, 22:08

I figured it out. It was because the primeng version 6.1.0. if I changed to version 6.0.0 it works again. Is there any version relation or contrainst between Primeng Ultima and Primeng version?

merve7
Posts: 861
Joined: 12 Sep 2017, 10:44

10 Aug 2018, 10:14

Yes, InputSwitch component is changed in PrimeNG 6.1. Ultima isn't compatible with PrimeNG 6.1 now but we will upgrade in next week.

johnhoang
Posts: 13
Joined: 12 Apr 2017, 22:39

14 Aug 2018, 16:13

Thanks merve7.

Post Reply

Return to “Ultima - PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 7 guests