Skip to content

Commit 176555a

Browse files
committed
Added call to stopPropagation() when processing click events in the Button class
1 parent dc0c37b commit 176555a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/button/Button.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,8 @@ javaxt.dhtml.Button = function(parent, config) {
363363

364364

365365
//Create onclick function
366-
var onclick = function(){
366+
var onclick = function(e){
367+
e.stopPropagation();
367368
if (config.sound!=null) config.sound.play();
368369

369370

@@ -426,7 +427,7 @@ javaxt.dhtml.Button = function(parent, config) {
426427

427428
if ((duration <= 500 && distance <= 10) || //Quick tap
428429
(duration > 500 && distance <= 10)) { //Long press
429-
onclick();
430+
onclick(e);
430431
}
431432
else{
432433
setStyle(div, "button");
@@ -452,8 +453,8 @@ javaxt.dhtml.Button = function(parent, config) {
452453

453454
//return false;
454455
};
455-
div.onclick = function(){
456-
onclick();
456+
div.onclick = function(e){
457+
onclick(e);
457458
};
458459
div.onmouseover = function(){
459460

0 commit comments

Comments
 (0)