-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove Event.stopPropagation() from generated dist file #1
Comments
Picker need listener type "change" to get variable in event object. var picker = document.getElementById('picker');
function listenerEvent (event) {
console.log(event);
var color = event.detail[0];
console.log('Selected Color:', color);
picker.value = color;
}
picker.addEventListener('change', listenerEvent, false); |
And, please, remove stopPropagation from code :) |
@rasy-js Hello, thank you for your feedback :D I will add the information about the change event to the docs ;) |
Description about the event added by 63af3b5 |
@BennyAlex , now event is not bubbling, if register event on document. And then to click the picker elements. |
@rasy-js |
I planning to release the color picker as a basic javascript module without vue and vue-custom-element, which would reduce the size of the picker drastically, then |
It's very good idea, then can to close issue. |
@rasy-js |
It is better to get the element (e.g. by ID) and then register the event directly on it. |
@BennyAlex , Event delegation is good practice https://javascript.info/event-delegation document.addEventListener('change', function(e) {
var target = e.target;
switch(target.id) {
case 'picker':
// some code...
break;
case 'picker1':
// some code...
break;
default:
}
}); |
Hello, awesome plugin, but he does not work for me. Chrome v 61.0.3163.100.
I do not have errors in console. Pallete is drew, but not to change value in attribute. And do not highlight circles.
The text was updated successfully, but these errors were encountered: