bootstrap4-toggle icon indicating copy to clipboard operation
bootstrap4-toggle copied to clipboard

toggle component shows up as a checkbox

Open ptt-bs23 opened this issue 5 years ago • 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?

ptt-bs23 avatar Feb 17 '20 12:02 ptt-bs23

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

ToTenMilan avatar Dec 05 '20 12:12 ToTenMilan