Skip to content

EnvelopeSkeleton: add filler on hover to prevent text shifting #10583

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/components/EnvelopeSkeleton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@
<div v-show="forceDisplayActions || displayActionsOnHoverFocus"
class="list-item__actions"
@focusout="handleBlur">
<!-- These details aren't actually displayed, they are just there to prevent text jittering on hover -->
<div class="list-item__actions__filler">
<slot name="list-item__actions__filler">{{ details }}</slot>
</div>
<NcActions ref="actions"
:primary="isActive || active"
:aria-label="computedActionsAriaLabel"
Expand Down Expand Up @@ -595,6 +599,12 @@ export default {
.list-item__actions {
align-self: center;
margin-top: 0;

&__filler {
// For the one-line layout the filler has to be one line shorter seeing as the replaced information when
// hovering is on one line and not two, hence needing to use the default line height in the calculation
margin-bottom: calc((var(--default-line-height) * var(--default-font-size) - var(--default-grid-baseline) * 3) * -1);
}
}
}

Expand Down Expand Up @@ -633,6 +643,15 @@ export default {
justify-content: center;
align-self: start;
margin-top: 0;
display: flex;
flex-direction: column-reverse;
align-items: flex-end;

&__filler {
padding-right: calc(var(--default-grid-baseline) * 2 + 1px);
visibility: hidden;
margin-left: calc(var(--default-grid-baseline) * 2 + 1px);
}
}

}
Expand Down
Loading