moonshine-software / moonshine

Laravel Admin panel and more. Simple for beginners and powerful for experts. Using Blade, Alpine.js and Tailwind CSS.
https://moonshine-laravel.com
MIT License
797 stars 104 forks source link

Weird searchable select behavior #1334

Closed Katel1ne closed 2 weeks ago

Katel1ne commented 2 weeks ago

MoonShine Version

2.23.0

Laravel Version

11.30.0

PHP Version

8.3.12

Database Driver & Version

PostgreSQL 16.3

Description

image Searching in select files with numbers gives strange results

Steps To Reproduce

Use select input with options containing numbers, then try to filter it Example is shown above, Test 1234 was input, while Test 10.37 still not filtered out

lee-to commented 2 weeks ago

asyncSearch or just searchable? if the second then there is a default search from the library choices.js

Katel1ne commented 2 weeks ago

Yeah, just searchable, without async. Tested choices.js in playground - can confirm, same issue. But from searching it there I've found next comment - https://github.com/Choices-js/Choices/issues/135#issuecomment-1492853062 I think we should have ability to pass choices.js options and docs should cover this topic, as I think this problem can be pretty common when user wants to get exact match.

lee-to commented 2 weeks ago
fuseOptions: {
    threshold: 0,
    ignoreLocation: true
}

It seemed to me that the behavior of the options from the issue is more obvious by default, for now we will leave it by default and then add the ability to configure it for yourself