gitbrent/bootstrap4-toggle

toggle component shows up as a checkbox

Opened this issue · 1 comments

I made a toggle switch component in react with bootstrap4-toggle and it looks like this:

import React, { Component } from "react";
import "bootstrap4-toggle/css/bootstrap4-toggle.min.css";

class ToggleSwitch extends Component {
  render() {
    return (
      <div className="toggle-switch">
        <input
          type="checkbox"
          data-toggle="toggle"
          data-on="Ready"
          data-off="Not Ready"
          data-onstyle="success"
          data-offstyle="danger"
        />
      </div>
    );
  }
}

export default ToggleSwitch;

But it shows like a simple checkbox. No error in console. Any help on this?

I had this issue two times. The first time, toggles were initially showing as a simple checkbox, no classes applied, but after the page reload, the form properly shows toggles. I "fixed" it by changing the form attribute from remote: true to remote: false
The second time toggles are not showing initially even with remote: false and I didn't found a solution yet