Element: [Feature Request] Promote options starting with search query when component is in filterable mode

Created on 23 Nov 2018  ·  2Comments  ·  Source: ElemeFE/element

Existing Component

Yes

Component Name

el-select

Description

With an el-select containing this options:

Ancona
Como
Paris
Madrid

_Current behavior:_
If I set el-select in filterable mode and type co in search query I see this result:

Ancona
Como

_Expected behavior:_
It would be better if labels starting with the search query were promoted in the result:

Como
Ancona

Most helpful comment

@carlfranz default filter-method uses indexOf. But you can write your own filter-method.

All 2 comments

@carlfranz default filter-method uses indexOf. But you can write your own filter-method.

Hey @ziyoung we've tried to implement the solution with filter-method. It works nicely, but the up/down keyboard handler keeps the alphabetical order.

Was this page helpful?
0 / 5 - 0 ratings