Opened 13 years ago

Closed 13 years ago

Last modified 10 years ago

#5687 closed enhancement (wontfix)

Cancellable beforeClose event in the Autocompletor

Reported by: keithpitt Owned by:
Priority: minor Milestone:
Component: ui.autocomplete Version: 1.8.1
Keywords: beforeClose event cancel Cc:
Blocked by: Blocking:


At the moment, there is no way to cancel the closing of the autocomplete menu after it opens. A use case for this is:

1) Member types something into the box 2) Autocomplete menu appears 3) User cannot navigate away from the text field until a selection is made.

Change History (3)

comment:1 Changed 13 years ago by keithpitt

Already fixed this problem at:

comment:2 Changed 13 years ago by Jörn Zaefferer

Resolution: wontfix
Status: newclosed

We're not going to implement this based on your usecase. Forcing the user to fill out a field with no escape isn't something we want to support.

Anyway, to avoid having to modify the UI source code, you could do this:

$.widget("keithpitt.forcedAutocomplete", $.ui.autocomplete, {
  close: function() {
    // some condition here
    $.ui.autocomplete.prototype.close.apply(this, arguments);

jsbin example:

comment:3 Changed 10 years ago by Scott González

Milestone: TBD

Milestone TBD deleted

Note: See TracTickets for help on using tickets.