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

[bug]: Autocomplete Suggestions #87

Open
tyleryy opened this issue Aug 25, 2024 · 2 comments
Open

[bug]: Autocomplete Suggestions #87

tyleryy opened this issue Aug 25, 2024 · 2 comments

Comments

@tyleryy
Copy link

tyleryy commented Aug 25, 2024

Describe the bug

Can't scroll if there are too many options in the Autocomplete Suggestions Popover.

How to reproduce

Add many tags to the autocompleteOptions where it will overflow

Link to reproduction

https://github.com/JaleelB/emblor

Additional information

No response

@Mirthis
Copy link

Mirthis commented Aug 29, 2024

You can specify a max-size for the popover and add overflow auto.
This is the snippet from the code I'm using:

styleClasses={{    
  autoComplete: {
    popoverContent: "max-h-[150px] overflow-y-auto",
  },
}}

@tyleryy
Copy link
Author

tyleryy commented Aug 31, 2024

I tried adding the styleClasses, but it still seems to be unscrollable. It is currently within a shadcn stepper component within a form.

Screen.Recording.2024-08-30.at.10.44.17.PM.mov
                              <TagInput
                                      {...field}
                                      styleClasses={{
                                        autoComplete: {
                                          popoverContent:
                                            "max-h-[200px] overflow-y-auto z-100",
                                        },
                                      }}
                                      placeholder="Enter a tag"
                                      tags={tags}
                                      className="sm:min-w-[450px]"
                                      activeTagIndex={activeTagIndex}
                                      setActiveTagIndex={setActiveTagIndex}
                                      enableAutocomplete
                                      autocompleteOptions={TagChoices}
                                      restrictTagsToAutocompleteOptions
                                      setTags={(newTags) => {
                                        setTags(newTags);
                                        setValue(
                                          "tags",
                                          newTags as [Tag, ...Tag[]]
                                        );
                                      }}
                                      truncate={5}
                                      clearAll
                                    />

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

No branches or pull requests

2 participants