Git Product home page Git Product logo

react-toggle-switch's People

Contributors

cjpete avatar mckernanin avatar peterhadlaw avatar pgrimard avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

react-toggle-switch's Issues

clicking doesn't toggle visually

<Switch onClick={this.toggleSwitch}/>

toggleSwitch() {
  this.setState({switched: !this.state.switched});
}

I'm click on next example
switcherror

when I console.log the state it switches from false/true but doesn't show visually on the toggle

onClick prop should be optional

The latest doc change indicates you can indirectly toggle the switch via the "on" prop, but not having an onClick still throws an undefined err.

non min css

Could your provide the non-minified version of the css also?

CWE-79 weakness in docs

In Bootstrap before 4.1.2, XSS is possible in the collapse data-parent attribute.

In Bootstrap before 4.1.2, XSS is possible in the data-target property of scrollspy.

In Bootstrap before 4.1.2, XSS is possible in the data-container property of tooltip.

In Bootstrap before 3.4.1 and 4.3.x before 4.3.1, XSS is possible in the tooltip or popover data-template attribute.

All inside react-toggle-switch/docs/scripts/bundle.min.js

Float Right in CSS

IMO the float:right in .switch is not necessary...it even causes minor layout issues.

Keyboard Accessibility

The Problem

Keyboard users are currently not able to interact with or toggle a Switch.

The Solution

Within src/scripts/switch.js, add a tabIndex="0" and onKeyPress={e => (enabled ? onClick(e) : onDisabledClick(e))} to the returned containing div.

Bonus Points

Add a proper keypress handler that only listens for enter (keycode 13) and space (keycode 32).

Disabled option

Hi
Thanks for your plugin, Could you please add this feature props ?

3rd state

I'd like to implement the 3rd state between on / off because I need to handle an "processing" method that could pass or fail.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.