Skip to content

Custom autocomplete filterFn and custom selection handling #36

@ryansuhartanto

Description

@ryansuhartanto

I want to use autocomplete with input chips, but it's currently it's impossible because of missing first-class support for custom filtering such as a fuzzy finder and custom selection handling.

Please add a filterFn and maybe @input and .entries function to support these.

Example

<m3e-form-field>
  <label slot="label" for="fruit">Choose your favorite fruit</label>
  <m3e-input-chip-set aria-label="Enter people">
    <input id="people" slot="input" placeholder="New person..." />
  </m3e-input-chip-set>
</m3e-form-field>
<m3e-autocomplete
  for="people"
  .entries=${[...arrayOfPeople]}
  .filterFn=${() => {/* Handle fuzzy finder */}}
  @input=${/* Handle what happen when an option is selected */}
>
</m3e-autocomplete>

This are required for input chip that shows rich-tooltip of a person's name, email, phone, etc. and also support custom entry such as Add new + that do opens a dialog instead.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions