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

Fix data table HTML column labels on mobile #1409

Merged
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@
}
}
}

waitingallday marked this conversation as resolved.
Show resolved Hide resolved
&__mobile-label {
display: none;
}
}

.rpl-data-table--mobile {
Expand Down Expand Up @@ -151,9 +155,8 @@
}
}

[data-label]::before {
.rpl-data-table__mobile-label {
font-weight: var(--rpl-type-weight-bold);
content: attr(data-label);
display: block;
margin-bottom: var(--rpl-sp-1);
}
Expand All @@ -166,8 +169,8 @@
line-height: var(--rpl-type-lh-4);
letter-spacing: var(--rpl-type-ls-1);

&[data-label]::before {
content: '';
.rpl-data-table__mobile-label {
display: none;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ const getCellText = (col?: number | string, value = '') => {
:is="i === 0 && verticalHeader ? 'th' : 'td'"
v-for="(column, i) of columns"
:key="i"
:data-label="column.label"
Copy link
Contributor

Choose a reason for hiding this comment

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

Hey @bgilhome-now, thanks for fixing this.

Can we please add the data-label back in for now, it won't be used for displaying content but there is some other stuff around that utilises it i.e. tests.

Cheers

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @lambry , done!

>
<div class="rpl-data-table__mobile-label" v-html="column.label" />
<template v-if="hasComponent(column)">
<component
:is="(column as tableColumnConfig).component"
Expand Down