Closed nikhil-varma closed 2 years ago
@yury-dymov Can you please review this?
@yury-dymov Please let me know if this is possible to release soon 🙂 Thanks!
Hi, thank you for the contribution. As you might have seen, I don't actively support things unfortunately :/
Even though I understand the edge case you are trying to fix, I don't agree with the solution as it breaks existing behavior for regular case having only one word available with the length > 1, and therefore I am not going to merge it.
However, I am okay with following:
if (
slug.matchLength >= minChars
&& (
slug.options.length > 1
|| (
slug.options.length === 1
&& (slug.options[0].length !== slug.matchLength || slug.options[0].length === 1)
...
This is something I can land if it helps.
@yury-dymov Thank you so much for getting back and reviewing this. Really appreciate your thought for this.
I have incorporated the suggested change and have tested it. Does this look okay?
I have updated the codesandbox link as well. Please let me know if we can merge this. 🙂
Thank you again!
If there are any options with a single character, the autocomplete input field ignores that and does not show anything in the dropdown as choices.
This PR fixes this by ensuring that options with at least one character is used.
Eg:
[z]
is the only option that is available. If you typez
in the input, it does not show up in the autocomplete dropdownCodesandbox link - with error and with fix
https://codesandbox.io/s/dazzling-morse-ybiwd7