fix(editor): clicking the sorting button results in an error (#10800)
This commit is contained in:
@@ -63,9 +63,7 @@ export class DataViewRenderer extends SignalWatcher(
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
private readonly _view = signal<{
|
private readonly _view = signal<DataViewInstance>();
|
||||||
expose: DataViewInstance;
|
|
||||||
}>();
|
|
||||||
|
|
||||||
@property({ attribute: false })
|
@property({ attribute: false })
|
||||||
accessor config!: DataViewRendererConfig;
|
accessor config!: DataViewRendererConfig;
|
||||||
@@ -121,7 +119,7 @@ export class DataViewRenderer extends SignalWatcher(
|
|||||||
});
|
});
|
||||||
|
|
||||||
focusFirstCell = () => {
|
focusFirstCell = () => {
|
||||||
this.view?.expose.focusFirstCell();
|
this.view?.focusFirstCell();
|
||||||
};
|
};
|
||||||
|
|
||||||
openDetailPanel = (ops: {
|
openDetailPanel = (ops: {
|
||||||
@@ -224,7 +222,7 @@ export class DataView {
|
|||||||
private readonly _ref = createRef<DataViewRenderer>();
|
private readonly _ref = createRef<DataViewRenderer>();
|
||||||
|
|
||||||
get expose() {
|
get expose() {
|
||||||
return this._ref.value?.view?.expose;
|
return this._ref.value?.view;
|
||||||
}
|
}
|
||||||
|
|
||||||
render(props: DataViewRendererConfig) {
|
render(props: DataViewRendererConfig) {
|
||||||
|
|||||||
@@ -44,9 +44,7 @@ type DataViewComponent = UniComponent<
|
|||||||
{
|
{
|
||||||
props: DataViewProps;
|
props: DataViewProps;
|
||||||
},
|
},
|
||||||
{
|
DataViewInstance
|
||||||
expose: DataViewInstance;
|
|
||||||
}
|
|
||||||
>;
|
>;
|
||||||
|
|
||||||
export interface DataViewRendererConfig {
|
export interface DataViewRendererConfig {
|
||||||
|
|||||||
@@ -169,8 +169,7 @@ export class DatabaseHeaderColumn extends SignalWatcher(
|
|||||||
|
|
||||||
const sortUtils = createSortUtils(
|
const sortUtils = createSortUtils(
|
||||||
sortTrait,
|
sortTrait,
|
||||||
this.closest('affine-data-view-renderer')?.view?.expose.eventTrace ??
|
this.closest('affine-data-view-renderer')?.view?.eventTrace ?? (() => {})
|
||||||
(() => {})
|
|
||||||
);
|
);
|
||||||
const sortList = sortUtils.sortList$.value;
|
const sortList = sortUtils.sortList$.value;
|
||||||
const existingIndex = sortList.findIndex(
|
const existingIndex = sortList.findIndex(
|
||||||
|
|||||||
Reference in New Issue
Block a user