Skip to content

Conversation

@tcarro927
Copy link

Need a way to specify that autocomplete uses exact matching when suggesting options.

I have a use case where the user types 'at' and autocomplete displays the following options:

atsec
attempt
active
datacenter

Users only want to see options that begin with the letters 'at' not options that contain a 'a' somewhere followed by a 't'. Setting the exactMatch property of the Autocomplete object gives users the required behavior, but the Autocomplete's exactMatch property is explicitly set to false with no way of changing it.

In this pull request, I added code to add an exactMatch configuration property to the editor object, and modified the AutoComplete object to set its exactMatch property from the configuration property's value. This allows my application to change the Autocomplete's behavior to match users' expectations.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@andrewnester andrewnester self-requested a review October 12, 2022 11:19
@codecov
Copy link

codecov bot commented Oct 12, 2022

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (1bc5d99) 86.96% compared to head (3f6741c) 86.96%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4949   +/-   ##
=======================================
  Coverage   86.96%   86.96%           
=======================================
  Files         562      562           
  Lines       45016    45016           
  Branches     6922     6923    +1     
=======================================
  Hits        39147    39147           
  Misses       5869     5869           
Flag Coverage Δ
unittests 86.96% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/editor.js 80.57% <ø> (ø)
src/autocomplete.js 80.12% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@amurph105
Copy link

I'm bumping this because this would be really useful.

@InspiredGuy InspiredGuy requested review from nightwing and removed request for andrewnester May 15, 2023 15:42
@akoreman
Copy link
Contributor

akoreman commented Jul 3, 2023

The option to do exact matches was added as part of PR #5084, closing this PR.

@akoreman akoreman closed this Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants