[Bug Report] VAutocomplete is filtering out non text item
See original GitHub issueEnvironment
Vuetify Version: 2.3.0-beta.6 Last working version: 2.2.28 Vue Version: 2.6.11 Browsers: Firefox 76.0 OS: Linux x86_64
Steps to reproduce
My VAutocomplete instance contains object items. By using filter
function as stated in the documentation, it receives item: object
, so I can filter the object with my own rules, and return either true
or false
.
Expected Behavior
When filter
function returns true
for an item, it must be shown.
Actual Behavior
It is filtered out by f8068ed6d4905c953463cf898150aae0b940fc3e for no explicit reason.
Reproduction Link
https://codepen.io/glandos/pen/LYpMdGO
Other comments
Maybe update the documentation to requires that getText
must return a value? But I see no reason to remove items if the user wants to filter it manually.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
wrong highlighting of matched text when using custom filter ...
[Bug Report] v-select with autocomplete - wrong highlighting of matched text when using ... The filtered items are highlighter correctly.
Read more >Issues for Views Autocomplete Filters | Drupal.org
Title Status Prior...
Autocomplete field search results incorrect width Needs review Nor...
The search text after the slash is missed Needs review Nor...
Not working with...
Read more >Filter Autocomplete suggestions does not work - Bug reports
The filter does still work if you enter in a valid filter... The fields are Category and set to Search Box in the...
Read more >autocomplete search filter not showing on second item set on ...
1) run app click 'swap search' and the 'text'; is set and shows the filtered items and click an item to set. 2)...
Read more >Why AutoComplete does not filter using text field - Syncfusion
To filter items in AutoComplete based on both text and value fields, use predicate of dataManager using the filtering event. The filtered data...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The dividers and headers were never shown when searching; I’m not sure how this affects the layout. Both my fix and the proposal in #11442 made assumptions on what the user would want. #11442 checks to see if the object is specifically
divider
orheader
while f8068ed says if there isn’t a text value to display, there is no point in sending back the result.With that being said, I agree that the items should pass to the filter regardless. This is what I’m planning on implementing as a fix that keeps #11415 resolved as well as resolving this one.
Your correction is OK for me, many thanks for that!
I have to admit that I was in a hurry when submitting the bug, and I didn’t really explain why I needed this. I am using
VAutocomplete
in an unusual way that can display multiple elements depending on what’s typed, and separate elements by dividers if needed. This is like a search box with different sources and different result types. So I still need header and dividers after filtering, based on my customfilter
function.