resolves #403 - preventDefault for click on anchor

This commit is contained in:
Mark Nadig 2011-12-16 14:32:32 -07:00
parent 47bc14148f
commit cf23dc522d
2 changed files with 4 additions and 0 deletions

View file

@ -90,6 +90,8 @@ class Chosen extends AbstractChosen
if @is_multiple
@search_choices.click (evt) => this.choices_click(evt)
@search_field.focus (evt) => this.input_focus(evt)
else
@container.click (evt) => evt.preventDefault() # gobble click of anchor
search_field_disabled: ->
@is_disabled = @form_field_jq[0].disabled

View file

@ -83,6 +83,8 @@ class Chosen extends AbstractChosen
if @is_multiple
@search_choices.observe "click", (evt) => this.choices_click(evt)
@search_field.observe "focus", (evt) => this.input_focus(evt)
else
@container.observe "click", (evt) => evt.preventDefault() # gobble click of anchor
search_field_disabled: ->
@is_disabled = @form_field.disabled