Skip to content

fix(VTimeline): isolate styles from nested timelines - #23228

Merged
J-Sek merged 4 commits into
vuetifyjs:masterfrom
morimorimokenpi:fix/vtimeline-nested-connectors
Sep 29, 2026
Merged

J-Sek merged 4 commits into
vuetifyjs:masterfrom
morimorimokenpi:fix/vtimeline-nested-connectors

Conversation

@morimorimokenpi

@morimorimokenpi morimorimokenpi commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Description

  • avoid leaking styles to nested v-timeline's

fixes #21426

Markup:

<template>
  <v-app>
    <v-main>
      <v-container>
        <div class="d-flex flex-column ga-8">
          <code>issue repro: nested, both align="start"</code>
          <v-row align="start">
            <v-col cols="6">
              <v-timeline
                align="start"
                density="compact"
                line-inset="12"
                side="end"
                truncate-line="both"
              >
                <v-timeline-item v-for="i in 2" :key="i" dot-color="primary" width="100%">
                  <div>Outer {{ i }}</div>
                  <v-timeline
                    align="start"
                    density="compact"
                    line-inset="12"
                    side="end"
                    truncate-line="both"
                  >
                    <v-timeline-item v-for="j in 2" :key="j" dot-color="info" size="small">
                      <div>Inner {{ i }}-{{ j }}</div>
                      <div class="text-medium-emphasis">Second line</div>
                    </v-timeline-item>
                  </v-timeline>
                </v-timeline-item>
              </v-timeline>
            </v-col>
            <v-col cols="6">
              <code>expected (fixed)</code>
              <v-timeline
                align="start"
                density="compact"
                line-inset="12"
                side="end"
                truncate-line="both"
              >
                <v-timeline-item v-for="j in 2" :key="j" dot-color="info" size="small">
                  <div>Inner {{ j }}</div>
                  <div class="text-medium-emphasis">Second line</div>
                </v-timeline-item>
              </v-timeline>
            </v-col>
          </v-row>

          <v-divider />
          <code>outer align="start" → inner align="center"</code>
          <v-row align="start">
            <v-col cols="6">
              <v-timeline
                align="start"
                density="compact"
                side="end"
                truncate-line="both"
              >
                <v-timeline-item v-for="i in 2" :key="i" dot-color="primary" width="100%">
                  <div>Outer {{ i }}</div>
                  <v-timeline density="compact" side="end">
                    <v-timeline-item v-for="j in 3" :key="j" dot-color="info" size="small">
                      <div>Inner {{ i }}-{{ j }}</div>
                      <div class="text-medium-emphasis">Second line</div>
                      <div class="text-medium-emphasis">Third line</div>
                    </v-timeline-item>
                  </v-timeline>
                </v-timeline-item>
              </v-timeline>
            </v-col>
            <v-col cols="6">
              <code>expected</code>
              <v-timeline density="compact" side="end">
                <v-timeline-item v-for="j in 3" :key="j" dot-color="info" size="small">
                  <div>Inner {{ j }}</div>
                  <div class="text-medium-emphasis">Second line</div>
                  <div class="text-medium-emphasis">Third line</div>
                </v-timeline-item>
              </v-timeline>
            </v-col>
          </v-row>

          <v-divider />
          <code>outer vertical → inner horizontal</code>
          <v-row align="start">
            <v-col cols="6">
              <v-timeline density="compact" side="end" truncate-line="both">
                <v-timeline-item v-for="i in 2" :key="i" dot-color="primary" width="100%">
                  <div>Outer {{ i }}</div>
                  <v-timeline direction="horizontal">
                    <v-timeline-item v-for="j in 3" :key="j" dot-color="info" size="small">
                      Inner {{ i }}-{{ j }}
                    </v-timeline-item>
                  </v-timeline>
                </v-timeline-item>
              </v-timeline>
            </v-col>
            <v-col cols="6">
              <code>expected</code>
              <v-timeline direction="horizontal">
                <v-timeline-item v-for="j in 3" :key="j" dot-color="info" size="small">
                  Inner {{ j }}
                </v-timeline-item>
              </v-timeline>
            </v-col>
          </v-row>
        </div>
      </v-container>
    </v-main>
  </v-app>
</template>

@J-Sek

J-Sek commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

we could cover 2 more cases:

Details
<template>
  <v-app>
    <v-main>
      <v-container>
        <div class="d-flex flex-column ga-8">
          <code>issue repro: nested, both align="start"</code>
          <v-row align="start">
            <v-col cols="6">
              <v-timeline
                align="start"
                density="compact"
                line-inset="12"
                side="end"
                truncate-line="both"
              >
                <v-timeline-item v-for="i in 2" :key="i" dot-color="primary" width="100%">
                  <div>Outer {{ i }}</div>
                  <v-timeline
                    align="start"
                    density="compact"
                    line-inset="12"
                    side="end"
                    truncate-line="both"
                  >
                    <v-timeline-item v-for="j in 2" :key="j" dot-color="info" size="small">
                      <div>Inner {{ i }}-{{ j }}</div>
                      <div class="text-medium-emphasis">Second line</div>
                    </v-timeline-item>
                  </v-timeline>
                </v-timeline-item>
              </v-timeline>
            </v-col>
            <v-col cols="6">
              <code>expected (fixed)</code>
              <v-timeline
                align="start"
                density="compact"
                line-inset="12"
                side="end"
                truncate-line="both"
              >
                <v-timeline-item v-for="j in 2" :key="j" dot-color="info" size="small">
                  <div>Inner {{ j }}</div>
                  <div class="text-medium-emphasis">Second line</div>
                </v-timeline-item>
              </v-timeline>
            </v-col>
          </v-row>

          <v-divider />
          <code>outer align="start" → inner align="center"</code>
          <v-row align="start">
            <v-col cols="6">
              <v-timeline
                align="start"
                density="compact"
                side="end"
                truncate-line="both"
              >
                <v-timeline-item v-for="i in 2" :key="i" dot-color="primary" width="100%">
                  <div>Outer {{ i }}</div>
                  <v-timeline density="compact" side="end">
                    <v-timeline-item v-for="j in 3" :key="j" dot-color="info" size="small">
                      <div>Inner {{ i }}-{{ j }}</div>
                      <div class="text-medium-emphasis">Second line</div>
                      <div class="text-medium-emphasis">Third line</div>
                    </v-timeline-item>
                  </v-timeline>
                </v-timeline-item>
              </v-timeline>
            </v-col>
            <v-col cols="6">
              <code>expected</code>
              <v-timeline density="compact" side="end">
                <v-timeline-item v-for="j in 3" :key="j" dot-color="info" size="small">
                  <div>Inner {{ j }}</div>
                  <div class="text-medium-emphasis">Second line</div>
                  <div class="text-medium-emphasis">Third line</div>
                </v-timeline-item>
              </v-timeline>
            </v-col>
          </v-row>

          <v-divider />
          <code>outer vertical → inner horizontal</code>
          <v-row align="start">
            <v-col cols="6">
              <v-timeline density="compact" side="end" truncate-line="both">
                <v-timeline-item v-for="i in 2" :key="i" dot-color="primary" width="100%">
                  <div>Outer {{ i }}</div>
                  <v-timeline direction="horizontal">
                    <v-timeline-item v-for="j in 3" :key="j" dot-color="info" size="small">
                      Inner {{ i }}-{{ j }}
                    </v-timeline-item>
                  </v-timeline>
                </v-timeline-item>
              </v-timeline>
            </v-col>
            <v-col cols="6">
              <code>expected</code>
              <v-timeline direction="horizontal">
                <v-timeline-item v-for="j in 3" :key="j" dot-color="info" size="small">
                  Inner {{ j }}
                </v-timeline-item>
              </v-timeline>
            </v-col>
          </v-row>
        </div>
      </v-container>
    </v-main>
  </v-app>
</template>

@morimorimokenpi

Copy link
Copy Markdown
Contributor Author

@J-Sek Thank you for suggesting the additional cases.

I updated the styles to scope direction, alignment, side, and density rules to the items directly owned by each VTimeline. I verified all three cases from your playground:

  • nested timelines with align="start"
  • outer align="start" with inner align="center"
  • outer vertical timeline with an inner horizontal timeline

The nested timelines now match the standalone expected layouts in all three cases. The existing VTimeline browser tests also pass (6/6).

@J-Sek J-Sek changed the title fix(VTimeline): scope connector styles to direct items fix(VTimeline): isolate styles from nested timelines Sep 29, 2026
@J-Sek
J-Sek merged commit 4b1919e into vuetifyjs:master Sep 29, 2026
9 checks passed
@morimorimokenpi
morimorimokenpi deleted the fix/vtimeline-nested-connectors branch September 29, 2026 16:02
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

Successfully merging this pull request may close these issues.

[Bug Report][3.8.5] v-timeline-item does not render bottom connector line when nested in another v-timeline and it is the last item

2 participants