Skip to content

Configuration option for filtering created items #410

Closed
@nlwillia

Description

@nlwillia

This is a feature request.

In create mode, it would be useful to be able to provide a predicate function as a configuration option that would take the current search value and return whether to allow an option/item to be inserted for it. Like the function variant of the current create option, the filter option function should accept a value and a callback so that the filter can be implemented synchronously or asynchronously.

For example:

$(...).selectize({
  create: true,
  createFilter: function(value, callback) {
    return ...; // some truthy result based on value OR undefined with the intent to invoke the callback later
  }
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions