Kieran Headley
Kieran Headley

Reputation: 993

jQuery stop event from happening

I am using jQuery Nestable http://dbushell.github.io/Nestable/ and have converted all of the items into a text box so they can be updated, now the problem is that when you click on the item it starts to move them and will not let you select the textbox.

To combat this I have used the below

event.stopPropagation()

However this only works on the first item, is there any way to get it to work for all items?

Upvotes: 1

Views: 101

Answers (1)

Amit Joki
Amit Joki

Reputation: 59232

use:

event.preventDefault();

This should help you.

From comments, I think this is what you are needing:

$('input[type=text]').mousedown(function(){
event.preventDefault();
});

Upvotes: 1

Related Questions