Skip to content

Commit 5a85d11

Browse files
fix: Table related e2e tests (#2322)
Co-authored-by: marcello-tk <awesomedevguynull@gmail.com>
1 parent fa9fe6a commit 5a85d11

File tree

3 files changed

+3
-24
lines changed

3 files changed

+3
-24
lines changed

docs/content/components/Table.md

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -228,28 +228,6 @@ Here, the component displays rocket information coming from the official SpaceX
228228
</App>
229229
```
230230

231-
### `dataIdProperty` (default: "id") [#dataidproperty-default-id]
232-
233-
This property defines the name of the property in each data item that holds the unique ID for that item. By default, the property is set to `id`. If your data items do not have an `id` property, you can set this property to the name of the property that holds the unique ID for each item.
234-
235-
If the first 3 of the data items do not have such a property, the table will generate unique IDs based on the index of each item in the data array. Note that this may lead to issues when the data changes, as the indices may not remain consistent, thus an `id` should be provided.
236-
237-
```xmlui copy /dataIdProperty="key"/
238-
<App>
239-
<Table
240-
dataIdProperty="key"
241-
rowsSelectable="true"
242-
data="{[
243-
{ 'key': 0, 'name': 'John' },
244-
{ 'key': 1, 'name': 'Jane' },
245-
{ 'key': 2, 'name': 'Bill' },
246-
]}"
247-
>
248-
<Column bindTo="name"/>
249-
</Table>
250-
</App>
251-
```
252-
253231
### `enableMultiRowSelection` (default: true) [#enablemultirowselection-default-true]
254232

255233
This boolean property indicates whether you can select multiple rows in the table. This property only has an effect when the rowsSelectable property is set. Setting it to `false` limits selection to a single row.

xmlui/src/components/Table/Table.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export const TableMd = createMetadata({
4343
`unique IDs based on the index of each item in the data array. Note that this may lead to ` +
4444
`issues when the data changes, as the indices may not remain consistent, thus an \`id\` should be provided.`,
4545
valueType: "string",
46-
defaultValue: defaultProps.dataIdProperty,
46+
defaultValue: "id",
4747
},
4848
isPaginated: {
4949
description: `This property adds pagination controls to the \`${COMP}\`.`,

xmlui/src/components/Table/TableNative.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,8 @@ const getCommonPinningStyles = (column: Column<RowWithOrder>): CSSProperties =>
231231
export const Table = forwardRef(
232232
(
233233
{
234-
dataIdProperty = defaultProps.dataIdProperty,
234+
// TEMP: will be removed in favor of idKey
235+
dataIdProperty,
235236
data = defaultProps.data,
236237
columns = defaultProps.columns,
237238
isPaginated = defaultProps.isPaginated,

0 commit comments

Comments
 (0)