Skip to content

Commit

Permalink
Fix measuring
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasMasuch committed Jan 12, 2024
1 parent e900935 commit b569edc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions packages/cells/src/cells/dropdown-cell.tsx
Expand Up @@ -112,6 +112,8 @@ const Editor: ReturnType<ProvideEditorCallback<DropdownCell>> = p => {
fontSize: theme.editorFontSize,
fontFamily: theme.fontFamily,
cursor: isFocused ? "pointer" : undefined,
paddingLeft: theme.cellHorizontalPadding,
paddingRight: theme.cellHorizontalPadding,
":active": {
...base[":active"],
color: theme.accentFg,
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/cells/number-cell.tsx
Expand Up @@ -16,7 +16,7 @@ export const numberCellRenderer: InternalCellRenderer<NumberCell> = {
useLabel: true,
drawPrep: prepTextCell,
draw: a => drawTextCell(a, a.cell.displayData, a.cell.contentAlign),
measure: (ctx, cell) => ctx.measureText(cell.displayData).width + 16,
measure: (ctx, cell, theme) => ctx.measureText(cell.displayData).width + theme.cellHorizontalPadding * 2,
onDelete: c => ({
...c,
data: undefined,
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/cells/row-id-cell.tsx
Expand Up @@ -11,7 +11,7 @@ export const rowIDCellRenderer: InternalCellRenderer<RowIDCell> = {
needsHoverPosition: false,
drawPrep: (a, b) => prepTextCell(a, b, a.theme.textLight),
draw: a => drawTextCell(a, a.cell.data, a.cell.contentAlign),
measure: (ctx, cell) => ctx.measureText(cell.data).width + 16,
measure: (ctx, cell, theme) => ctx.measureText(cell.data).width + theme.cellHorizontalPadding * 2,
// eslint-disable-next-line react/display-name
provideEditor: () => p => {
const { isHighlighted, onChange, value, validatedSelection } = p;
Expand Down

0 comments on commit b569edc

Please sign in to comment.