-
Notifications
You must be signed in to change notification settings - Fork 98
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
feat(Table): expand checkbox click area #654
Conversation
Preview is ready. |
@krozhkov can you take a look on this pr? |
@amje maybe you? lgtm :) |
src/components/Table/hoc/withTableSelection/withTableSelection.tsx
Outdated
Show resolved
Hide resolved
@amje Can you check please? |
@Bluepuper |
832a178
to
8e360f2
Compare
Add min-width of checkbox to cell, so it will not be shrinking |
|
||
#{variables.$block} { | ||
&__selection-checkbox { | ||
display: inline-block; | ||
@extend #{variables.$block}__cell; | ||
@extend #{variables.$block}__cell_edge-padding; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about styles when edgePadding: false
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove duplicating styles
src/components/Table/hoc/withTableSelection/withTableSelection.scss
Outdated
Show resolved
Hide resolved
src/components/Table/Table.tsx
Outdated
@@ -152,6 +152,7 @@ export class Table<I extends TableDataItem = Record<string, string>> extends Rea | |||
content = id; | |||
} | |||
|
|||
if (id === '_selection') return content; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did this to remove double wrapping of checkbox so padding: inherit
will work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But now selection hoc "data" leaked to the base Table. Let's find a workaround here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this wrapper really breaks the layout?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i can add different wrapper for cell with id === '_selection'
, something like this:
if (id === '_selection') return <span className={b('th-content_selection')}>content</span>;
before if was just like this return <span className={b('th-content')}>{content}</span>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Bluepuper I think we can remove this wrapper (th-content
) completely, and add these styles instead:
&__head &__cell {
@include mixins.text-accent;
&::first-letter {
text-transform: uppercase;
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can remove this wrapper (
th-content
) completely, and add these styles instead:&__head &__cell { @include mixins.text-accent; &::first-letter { text-transform: uppercase; } }
like this ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you check it please ?) @amje |
… wrapper to selection checkbox
af2ecc1
to
07e0f1c
Compare
@EgorKluch I assume, yes. Now it's an equal padding between all cells |
But then needs to move up text too. I'm waiting for the final decision. |
@EgorKluch Oh, I thought you're talking about horizontal alignment. Checkbox should be centered as well when |
It turns out that the row height was wrong before this pr based on the design. This pr also fixes that, now it is correct: 40px height + 1px bottom border. Before it was 40.5 px inner height + 1px border bottom |
Issue: #648