From 4da499ab245765272ddf46a29bda5f5cfe1c05ff Mon Sep 17 00:00:00 2001 From: Chadwick Meyer Date: Wed, 3 Jun 2015 16:03:35 -0700 Subject: [PATCH] Fix issue with Delete reloading top of Page In my experience, clicking the delete button on a bit tag, caused the page to reload at the top because it's an anchor tag with an href. This probably shouldn't be an anchor tag, but if it is going to be, we don't want the browser interpreting that click event. So making the `href= "javascript:void(0);"` will stop that. You could also put an `e.stop()` function on the click. --- Source/TextboxList.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/TextboxList.js b/Source/TextboxList.js index 5f69556..8373af1 100644 --- a/Source/TextboxList.js +++ b/Source/TextboxList.js @@ -428,9 +428,9 @@ TextboxListBit.Box = new Class({ this.bit.addEvent('click', this.focus.bind(this)); if (this.options.deleteButton){ this.bit.addClass(this.typeprefix + '-deletable'); - this.close = new Element('a', {href: '#', 'class': this.typeprefix + '-deletebutton', events: {click: this.remove.bind(this)}}).inject(this.bit); + this.close = new Element('a', {href: 'javascript:void(0)', 'class': this.typeprefix + '-deletebutton', events: {click: this.remove.bind(this)}}).inject(this.bit); } this.bit.getChildren().addEvent('click', function(e){ e.stop(); }); } -}); \ No newline at end of file +});