material-react-table 0.38.0 → 0.38.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -239,8 +239,8 @@ declare type MRT_TableInstance<TData extends Record<string, any> = {}> = Omit<Ta
239
239
  setDensity: Dispatch<SetStateAction<'comfortable' | 'compact' | 'spacious'>>;
240
240
  setDraggingColumn: Dispatch<SetStateAction<MRT_Column<TData> | null>>;
241
241
  setDraggingRow: Dispatch<SetStateAction<MRT_Row<TData> | null>>;
242
- setEditingCell: Dispatch<SetStateAction<MRT_Cell | null>>;
243
- setEditingRow: Dispatch<SetStateAction<MRT_Row | null>>;
242
+ setEditingCell: Dispatch<SetStateAction<MRT_Cell<TData> | null>>;
243
+ setEditingRow: Dispatch<SetStateAction<MRT_Row<TData> | null>>;
244
244
  setGlobalFilterFn: Dispatch<SetStateAction<MRT_FilterOption>>;
245
245
  setHoveredColumn: Dispatch<SetStateAction<MRT_Column<TData> | {
246
246
  id: string;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.38.0",
2
+ "version": "0.38.1",
3
3
  "license": "MIT",
4
4
  "name": "material-react-table",
5
5
  "description": "A fully featured Material UI V5 implementation of TanStack React Table V8, written from the ground up in TypeScript.",
@@ -109,8 +109,8 @@ export type MRT_TableInstance<TData extends Record<string, any> = {}> = Omit<
109
109
  setDensity: Dispatch<SetStateAction<'comfortable' | 'compact' | 'spacious'>>;
110
110
  setDraggingColumn: Dispatch<SetStateAction<MRT_Column<TData> | null>>;
111
111
  setDraggingRow: Dispatch<SetStateAction<MRT_Row<TData> | null>>;
112
- setEditingCell: Dispatch<SetStateAction<MRT_Cell | null>>;
113
- setEditingRow: Dispatch<SetStateAction<MRT_Row | null>>;
112
+ setEditingCell: Dispatch<SetStateAction<MRT_Cell<TData> | null>>;
113
+ setEditingRow: Dispatch<SetStateAction<MRT_Row<TData> | null>>;
114
114
  setGlobalFilterFn: Dispatch<SetStateAction<MRT_FilterOption>>;
115
115
  setHoveredColumn: Dispatch<
116
116
  SetStateAction<MRT_Column<TData> | { id: string } | null>
@@ -49,6 +49,15 @@ export const MRT_EditCellTextField = <TData extends Record<string, any> = {}>({
49
49
  const handleChange = (event: ChangeEvent<HTMLInputElement>) => {
50
50
  textFieldProps.onChange?.(event);
51
51
  setValue(event.target.value);
52
+ if (textFieldProps?.select && editingRow) {
53
+ setEditingRow({
54
+ ...editingRow,
55
+ _valuesCache: {
56
+ ...editingRow._valuesCache,
57
+ [column.id]: event.target.value,
58
+ },
59
+ });
60
+ }
52
61
  };
53
62
 
54
63
  const handleBlur = (event: FocusEvent<HTMLInputElement>) => {
@@ -57,7 +66,7 @@ export const MRT_EditCellTextField = <TData extends Record<string, any> = {}>({
57
66
  setEditingRow({
58
67
  ...editingRow,
59
68
  _valuesCache: { ...editingRow._valuesCache, [column.id]: value },
60
- } as any);
69
+ });
61
70
  }
62
71
  setEditingCell(null);
63
72
  };
@@ -72,7 +81,7 @@ export const MRT_EditCellTextField = <TData extends Record<string, any> = {}>({
72
81
  fullWidth
73
82
  label={showLabel ? column.columnDef.header : undefined}
74
83
  margin="none"
75
- name={cell.id}
84
+ name={column.id}
76
85
  onClick={(e: MouseEvent<HTMLInputElement>) => e.stopPropagation()}
77
86
  placeholder={columnDef.header}
78
87
  value={value}
@@ -299,7 +299,7 @@ export const MRT_FilterTextField: FC<Props> = ({
299
299
  }}
300
300
  sx={(theme) => ({
301
301
  p: 0,
302
- minWidth: !filterChipLabel ? '6rem' : 'auto',
302
+ minWidth: !filterChipLabel ? '150px' : 'auto',
303
303
  width: '100%',
304
304
  '& .MuiSelect-icon': {
305
305
  mr: '1.5rem',