Skip to content

Commit

Permalink
feat(Table): expand checkbox click area (#654)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bluepuper authored Oct 19, 2023
1 parent 64b8c58 commit 0534cf8
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/components/Table/Table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,8 @@
border-bottom-color: transparent;
}

&__th-content {
&__head &__cell {
@include mixins.text-accent;
display: inline-block;
&::first-letter {
text-transform: uppercase;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export class Table<I extends TableDataItem = Record<string, string>> extends Rea
content = id;
}

return <span className={b('th-content')}>{content}</span>;
return content;
}

static getBodyCellContent<I extends TableDataItem>(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
@use '../../variables';

#{variables.$block} {
&__checkbox_cell {
position: relative;
min-width: 17px;
}

&__selection-checkbox {
display: inline-block;
padding: inherit;
border-bottom: none;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}

&__row_selected {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export function withTableSelection<I extends TableDataItem, E extends {} = {}>(
id: selectionColumnId,
name: this.renderHeadCell,
template: this.renderBodyCell,
width: 17, // checkbox width
className: b('checkbox_cell'),
sticky: _get(columns, [0, 'sticky']) === 'left' ? 'left' : undefined,
};

Expand Down

0 comments on commit 0534cf8

Please sign in to comment.