Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

only show "Add with CTRL+Enter" only when there is no options to select from + cursor with single select #260

Closed
GamalTawaf opened this issue Oct 28, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@GamalTawaf
Copy link

GamalTawaf commented Oct 28, 2024

First, Thanks for the amazing library :)
I have two issues:

  1. The issue is basically the same as mentioned here: An option to show "Create with CTRL+Enter" only when there is no suggestion available #86. REPL
  2. the second one is when user selects one item we still see the cursor telling the user they can select another but I do not have multiple
    here is a demo of what I mean: I was allowed to add "test" even though it is part of the options

svelecte-issue-repl

Env:


    "svelecte": "^4.4.0",
    "svelte": "^4.0.5",

@GamalTawaf GamalTawaf changed the title only show "Add with CTRL+Enter" only when there is no options to select from + cusor with single select only show "Add with CTRL+Enter" only when there is no options to select from + cursor with single select Oct 28, 2024
@mskocik
Copy link
Owner

mskocik commented Oct 29, 2024

I have two issues:

  1. this cannot be done. You can't guarantee that user wouldn't want to insert some "substring" of available options. Take your example: If you would want to insert est it wouldn't be possible.
  2. is valid bug, but you should be using createFilter differently. I understand that docs are misleading (description of createFilter is still in v3 format). Your createFilter function should return true if you want to prevent item creation. Will be fixed soon.

@mskocik mskocik added the bug Something isn't working label Oct 29, 2024
@mskocik
Copy link
Owner

mskocik commented Oct 29, 2024

Now fixed in v4.4.1 and here is your REPL fixed (slightly updated filterCreate function)

@mskocik mskocik closed this as completed Oct 29, 2024
mskocik added a commit that referenced this issue Oct 29, 2024
mskocik added a commit that referenced this issue Oct 29, 2024
…cription in readme, fix #260

(cherry picked from commit 15c2b3e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants