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] v-tabs slider mispositioned on initial render with v-img in v-app-bar #13238

Closed
jaapspiering opened this issue Mar 9, 2021 · 3 comments
Labels
duplicate The issue has already been reported

Comments

@jaapspiering
Copy link

jaapspiering commented Mar 9, 2021

Environment

Vuetify Version: 2.4.5
Vue Version: 2.6.12
Browsers: Chrome 88.0.4324.192, Mozilla Firefox, Google Chrome
OS: Mac OS 11.2.2, Windows

Steps to reproduce

Create a v-app-bar with v-tabs (with fixed-tabs or grow option). After the v-tabs we have a v-img with the company logo.

Load the app - On initial render the slider for the currently selected tab is position too far to the right. When the page is redrawn (press F5, Ctrl-R, or open F12 Developer Tools for example) it moves to the correct position. This does not reproduce if there is no v-img present.

Expected Behavior

Slider aligned with the tab

Actual Behavior

Slider is placed too far to the right

Reproduction Link

https://codepen.io/jaapspiering/pen/ExNdXEQ

@ghost ghost added the S: triage label Mar 9, 2021
@jaapspiering
Copy link
Author

I just noticed the tabs move a bit to the left after the slider is first rendered, right when the image shows.
Adding the eager property to the v-img seems to do the trick and renders the slider correctly in one go.

@paddotk
Copy link

paddotk commented Apr 15, 2021

I omitted this issue by appying a key (:key) to the tab group and changing that key once after initial render. So something like

<v-tabs centered :key="tabsKey">
  data: () => ({
    tabsKey: 1
  }),
 mounted() {
  setTimeout(() => {
    this.tabsKey = 2;
  }, 100);
}

Not a very neat way but does the job.

@ElijahKotyluk ElijahKotyluk added the C: VTabs VTabs label Jun 24, 2021
@KaelWD
Copy link
Member

KaelWD commented Oct 12, 2021

Duplicate of #4733

@KaelWD KaelWD marked this as a duplicate of #4733 Oct 12, 2021
@KaelWD KaelWD closed this as completed Oct 12, 2021
@KaelWD KaelWD added duplicate The issue has already been reported and removed C: VTabs VTabs S: triage labels Oct 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate The issue has already been reported
Projects
None yet
Development

No branches or pull requests

4 participants