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

Allow setting minimum scrollbar thumb height in vertical n-scrollbar #6771

Open
3 tasks done
lanyeeee opened this issue Feb 22, 2025 · 0 comments · May be fixed by #6772
Open
3 tasks done

Allow setting minimum scrollbar thumb height in vertical n-scrollbar #6771

lanyeeee opened this issue Feb 22, 2025 · 0 comments · May be fixed by #6772
Labels
feature request New feature or request

Comments

@lanyeeee
Copy link

Clear and concise description of the problem

I want set the minimum height for the scrollbar thumb in n-scrollbar, so that the scrollbar remains usable when working with n-virtual-list containing large datasets.

Currently, when using n-virtual-list with a large amount of data, the scrollbar thumb becomes extremely small due to the automatic height calculation based on content proportion, which affects user interaction and experience.

While issue #6456 allows customizing the width of vertical scrollbar and height of horizontal scrollbar through theming, it doesn't address the need to set the minimum height for the vertical scrollbar thumb itself.

Suggested solution

Add a new property y-bar-min-size to n-scrollbar to set the minimum height of the scrollbar thumb:

Usage example:

<n-virtual-list
style="max-height: 240px"
:item-size="42"
:items="items"
:scrollbar-props="{ yBarMinSize: 20 }"
>
<template #default="{ item }">
  <div :key="item.key" class="item" style="height: 42px">
    <img class="avatar" :src="item.avatar" alt="" />
    <span> {{ item.value }}</span>
  </div>
</template>
</n-virtual-list>

Alternative

No response

Additional context

No response

Validations

  • Read the Contributing Guidelines.
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
@lanyeeee lanyeeee added the feature request New feature or request label Feb 22, 2025
@lanyeeee lanyeeee linked a pull request Feb 22, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant