Skip to content
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

fix: add extra conditions to help strict mode #302

Merged
merged 1 commit into from
Feb 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions src/slickgrid-react/components/slickgrid-react.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1520,21 +1520,23 @@ export class SlickgridReact<TData = any> extends React.Component<SlickgridReactP
* then take back "editor.model" and make it the new "editor" so that SlickGrid Editor Factory still works
*/
protected swapInternalEditorToSlickGridFactoryEditor(columnDefinitions: Column<TData>[]): Column<TData>[] {
if (columnDefinitions.some(col => `${col.id}`.includes('.'))) {
if (columnDefinitions.some(col => `${col?.id}`.includes('.'))) {
console.error('[Slickgrid-React] Make sure that none of your Column Definition "id" property includes a dot in its name because that will cause some problems with the Editors. For example if your column definition "field" property is "user.firstName" then use "firstName" as the column "id".');
}

return columnDefinitions.map((column: Column | any) => {
// on every Editor which have a "collection" or a "collectionAsync"
if (column.editor?.collectionAsync) {
this.loadEditorCollectionAsync(column);
}
if (column) {
// on every Editor which have a "collection" or a "collectionAsync"
if (column.editor?.collectionAsync) {
this.loadEditorCollectionAsync(column);
}

return {
...column,
editor: column.editor?.model,
internalColumnEditor: { ...column.editor }
};
return {
...column,
editor: column.editor?.model,
internalColumnEditor: { ...column.editor }
};
}
});
}

Expand Down