Comments (6)
http://jsfiddle.net/1uc4feys/4/
Here is the fiddle.
The problem happens when there is a <label>
around the <input>
.
from bootstrap-checkbox-x.
Even though base input is hidden - the label when clicked should trigger the change event for the checkbox plugin (just like a normal html checkbox).
So if you check the demo - clicking on the label will also toggle the checkbox.
Your problem is the use case where you are enveloping the label over the checkbox. Let me see if there is an option to add.
from bootstrap-checkbox-x.
Right. I think https://github.com/kartik-v/bootstrap-checkbox-x/blob/master/js/checkbox-x.js#L44 should stop the event propagation before calling change()
. Otherwise the event bubbles to the enveloping <label>
and triggers the click second time.
from bootstrap-checkbox-x.
But maybe there are use cases where the event should bubble ?!
from bootstrap-checkbox-x.
Plugin is upgraded to release v1.1.0. There is a new boolean property added - labelClickEvent
which defaults to true
. If set to false
, it will not trigger the change event on label click.
from bootstrap-checkbox-x.
Thanks!
Works like a charm!
from bootstrap-checkbox-x.
Related Issues (20)
- custom values not working HOT 2
- Two possible + set indeterminate
- encodeLabel possible? HOT 1
- Display initial value correctly when initializing with checkbox
- Add support for `bootstrap-sass` through new `sass` branch HOT 1
- Default Value HOT 1
- submit form need checkbox checked, but now 0 and empty is unchecked HOT 1
- NPM Package
- checkbox.change - triggers 2 times then user clicks on checkbox HOT 2
- custom values not working HOT 1
- Keeps returning 404 Not Found Error HOT 1
- Not working with angularJS app HOT 1
- Dynamically change Checked | Unchecked states HOT 1
- Rename events to start with `checkbox:` instead of ending with `.checkbox` HOT 1
- waiting for v1.5.5 HOT 1
- Use enhanced SVG icons
- Enhancements to support all bootstrap versions (5.x, 4.x. and 3.x)
- Revamp bootstrap checkbox-x markup for better styling & alignment across Bootstrap versions
- New boolean property `useCrossIcon` for checked
- Allow custom icon CSS for checked, unchecked and null states
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bootstrap-checkbox-x.