Option to configure fuseOptions.threshold in joomla-field-fancy-select #46953
Replies: 3 comments
-
|
If need more strict search then we can just reduce default value to let say 0.1 - 0.2. I do not see a need for introducing a new option. But can be added of course. |
Beta Was this translation helpful? Give feedback.
-
|
At the moment I’m developing a custom fields plugin where I use a list-fancy-select field containing numeric values. In that case, having a strict mode (even 0.0) would be important. On the other hand, for text searches the fuzzy logic could be indeed useful to balance out typos. That’s why I thought it might be helpful to make this configurable, while keeping it backwards compatible. Of course, the default value can still be adjusted as needed. |
Beta Was this translation helpful? Give feedback.
-
|
Okay, then it is fine |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is your feature request related to a problem? Please describe.
Currently
joomla-field-fancy-selectuses Choices.js withfuseOptions.threshold = 0.3.This causes fuzzy matching even for numeric lists. For example, searching
1043also returns results like1003,103,1031, etc.In some cases this behaviour is undesirable when exact matching is required.
Describe the solution you'd like
I was thinking it might be useful to make the
fuseOptions.thresholdconfigurable through an attribute (e.g.data-fuse-threshold="0").By default it could stay at
0.3, so the change would be fully backward compatible and not affect existing installations.Additional context
File:
media/system/js/fields/joomla-field-fancy-select.jsRelevant code:
Beta Was this translation helpful? Give feedback.
All reactions