Primeng: Reimplement InputSwitch

Created on 23 Jul 2018  路  9Comments  路  Source: primefaces/primeng

Modernize it using a css only approach like we did in React;

https://www.primefaces.org/primereact/#/inputswitch

enhancement

Most helpful comment

The inputswitch style on bootstrap theme is still broken on update 6.1.3. It shows a plain blue background without the switch.

All 9 comments

@cagataycivici New InputSwitch implementation seems broken with Bootstrap theme, style was messed up, though the component works.

Did you intentially remove onLabel and offLabel?
Is there some new approach to define custom texts?

Yeah, the removal of onLabel and offLabel is a breaking change that should have been communicated as part of a major release number, not 6.0.1 -> 6.0.2. Spent a lot of time scrambling this morning to figure out what the heck happened!

So whats the new approach to define labels for On and Off state?

The display text is now decoupled from the control. So you need to react to the InputSwitch state change and update your text accordingly.

The inputswitch style on bootstrap theme is still broken on update 6.1.3. It shows a plain blue background without the switch.

The inputswitch style on bootstrap theme is still broken on update 6.1.4.
So I have to trun to v6.0.0 to use this, wish it will work well soon.

The inputswitch style on bootstrap theme is still broken on update 7.1.0. It shows a plain blue background without the switch.
Any solutions planned ?

The inputswitch style on bootstrap theme is still broken on update 7.1.0. It shows a plain blue background without the switch.
Any solutions planned ?

Bootstrap theme is not maintained any more. I find inputswitch styles in nova theme and apply it. Should fix the problem.

Was this page helpful?
0 / 5 - 0 ratings