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

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

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
13 changes: 13 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>

Check warning on line 88 in src/components/EnvelopeSkeleton.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Expected 1 line break after opening tag (`<slot>`), but no line breaks found

Check warning on line 88 in src/components/EnvelopeSkeleton.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Expected 1 line break before closing tag (`</slot>`), but no line breaks found
</div>
<NcActions ref="actions"
:primary="isActive || active"
:aria-label="computedActionsAriaLabel"
Expand Down Expand Up @@ -633,6 +637,15 @@
justify-content: center;
align-self: start;
margin-top: 0;
display: flex;
flex-direction: column-reverse;
align-items: flex-end;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these will not be applied because the parent is display none. It still jumps for me

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GretaD The parent is display none only when not hovered, the idea here is that:

  • Before hover the date occupies space
  • After hover the actions occupy space, but less than the date

To fix this I added the filler only when actions are present, it takes up the same space that the date would have taken up. I just noticed however that there was a 1px difference and fixed it, could you please test again?


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

}
Expand Down
Loading