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] - NcSelect crashes on rendering a large amount of chips #4419

Open
Antreesy opened this issue Aug 14, 2023 · 3 comments
Open

[Bug] - NcSelect crashes on rendering a large amount of chips #4419

Antreesy opened this issue Aug 14, 2023 · 3 comments
Labels
0. to triage bug Something isn't working dependencies Pull requests that update a dependency file

Comments

@Antreesy
Copy link
Contributor

Current state

Was tested with system_tags.

  • All applied system tags come together in one XML line (around 3 kB of data transferred for 30 tags => 200 kB for 2k tags - not a big deal, I'd say)
  • NcSelect doesn't have a height and content limit, so it's possible to spam it with multiple labels, until it becomes large enough to fill the whole sidebar space, not allowing to see underlying tabs.
  • The dropdown with autocomplete and search through the list works fine on 200 tags, so I see nothing wrong with 2000
  • But 2000 tags which are picked are probably too much for the component, and NcSelect crashes on render them in visible area.
overflow of the page opened dropdown with 200 options
image image

Possible solution

  • Limit the number of visible 'selected' chips
@Antreesy Antreesy added bug Something isn't working 0. to triage labels Aug 14, 2023
@susnux
Copy link
Contributor

susnux commented Oct 15, 2023

For the overflow you can assign a class to the NcSelect like my-select and then add a styling like:

.my-select .vs__selected-options {
  max-height: 55px;
  overflow-y: scroll;
}

@susnux
Copy link
Contributor

susnux commented Oct 15, 2023

I tested 5000 chips, it renders ok, but takes a lot of time and probably will be stopped by most browsers.
So yes maybe we can add a limit, I do not really see a reason why you would ever select so many of the options?

@susnux
Copy link
Contributor

susnux commented Oct 15, 2023

@Antreesy I created a PR here with such a feature: nextcloud-libraries/vue-select#26

But not sure if this is a valid use case, so cc @Pytal
Would look like this on NcSelect:

a.mp4

@susnux susnux added the dependencies Pull requests that update a dependency file label Oct 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. to triage bug Something isn't working dependencies Pull requests that update a dependency file
Projects
None yet
Development

No branches or pull requests

2 participants