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 Report] size v-tabs-slider not updated after downloading fonts #10039

Closed
TreVld opened this issue Dec 25, 2019 · 2 comments
Closed

[Bug Report] size v-tabs-slider not updated after downloading fonts #10039

TreVld opened this issue Dec 25, 2019 · 2 comments
Labels
C: VTabs VTabs duplicate The issue has already been reported

Comments

@TreVld
Copy link
Contributor

TreVld commented Dec 25, 2019

Environment

Vuetify Version: 2.1.15
Vue Version: 2.6.10
Browsers: Chrome 79.0.3945.88
OS: Windows 10

Steps to reproduce

disable the cache, and verify that the size of the active tab and v-tabs-slider

Expected Behavior

the width of the slider should match the width of the active tab

Actual Behavior

the width of the slider is determined, after which the font is loaded and the width of the active tab changes, and the width of the slider remains the same

Reproduction Link

https://codesandbox.io/s/vuetify-playground-nr547

@ghost ghost added the S: triage label Dec 25, 2019
@TreVld
Copy link
Contributor Author

TreVld commented Dec 25, 2019

image

@jacekkarczmarczyk
Copy link
Member

Duplicate of #4733

We don't have a reasonable solution for now, you may try to solve it in userland with

  mounted () {
    const initial = this.$refs.tab.$el.offsetWidth;
    const interval = setInterval(() => {
      if (this.$refs.tab) {
        if (this.$refs.tab.$el.offsetWidth !== initial) {
          clearInterval(interval)
          this.$refs.tabs.callSlider()
        }
      }
    }, 1000)
  }

where $refs.tabs is the ref for the v-tabs and $refs.tab is the ref for the first v-tab (you may want to wrap the tab text in a <span> and check the span width instead of v-tab for more reliable effect)

@jacekkarczmarczyk jacekkarczmarczyk added C: VTabs VTabs duplicate The issue has already been reported and removed S: triage labels Jan 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VTabs VTabs duplicate The issue has already been reported
Projects
None yet
Development

No branches or pull requests

2 participants