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

Unexpected infinity scroll-X #29

Open
FreakyHead opened this issue Sep 15, 2020 · 3 comments
Open

Unexpected infinity scroll-X #29

FreakyHead opened this issue Sep 15, 2020 · 3 comments

Comments

@FreakyHead
Copy link

FreakyHead commented Sep 15, 2020

Hello, while x-scrolling got infinity scrolling and error in the console.

Tab in Tabs can be added and removed.
If I set the last tab is Active, the scroll width will be normal

<div class="flex">
      <vue-custom-scrollbar
        :settings="{ wheelPropagation: true }"
        tagname="div"
        class="flex overflow-x-scroll rounded-tl relative"
      >
        <div
          v-for="(tab, index) in tabs"
          :key="index"
          style="max-width: 200px;"
          :class="[
            'relative p-3',
            index === 0 ? 'rounded-tl' : '',
            tab.isActive ? 'bg-white' : 'bg-light-disabled',
          ]"
        >
          <h4
            @click="setActive(index)"
            class="cursor-pointer font-semibold text-md text-default"
          >
            ОСАГО
          </h4>
          <img
            v-if="tabs.length > 1"
            @click="removeTab(index)"
            :src="require('@/assets/icons/close.svg')"
            alt="Закрыть вкладку"
            class="absolute cursor-pointer"
            style="top: 10px; right: 10px;"
          />
          <p
            class="text-sm text-hint truncate"
            :title="tab.car.model ? tab.car.model : 'Новый расчет'"
          >
            {{ tab.car.model ? tab.car.model : 'Новый расчет' }}
          </p>
        </div>
      </vue-custom-scrollbar>

image

Details:

"vue": "^2.6.11",
"vue-custom-scrollbar": "^1.3.0"

@favoyang
Copy link

Happens to me, seems a bug of https://github.com/mdbootstrap/perfect-scrollbar.

Workaround: set suppressScrollX: true in settings.

@Binaryify
Copy link
Owner

Binaryify commented Sep 30, 2020

please create issues in https://github.com/mdbootstrap/perfect-scrollbar.
@DeeDab @favoyang

@favoyang
Copy link

favoyang commented Oct 3, 2020

I just realize it's my mistake, not this library or the perfect-scrollbar. I have a fixed div with margin-left, but the width is still 100%. That makes the x-axis overflow. After adding a rule to limit the width with calc(100% - $left). It works.

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

3 participants