Просмотр исходного кода

adjust to how height sync is done

Adam Shaw 5 лет назад
Родитель
Сommit
fc796bd667

+ 1 - 1
packages-premium

@@ -1 +1 @@
-Subproject commit 88f3ca5a2ae36f5841ccf6607a233839ad5db05f
+Subproject commit 84a6f565c273b6bf95ebeb295a33c708da8e1c52

+ 2 - 1
packages/core/src/scrollgrid/SimpleScrollGrid.tsx

@@ -111,8 +111,9 @@ export default class SimpleScrollGrid extends BaseComponent<SimpleScrollGridProp
       clientWidth: state.scrollerClientWidths[sectionI] || '',
       clientHeight: state.scrollerClientHeights[sectionI] || '',
       vGrowRows: sectionConfig.vGrowRows,
+      syncRowHeights: false,
       rowSyncHeights: [],
-      requestHeightSync: () => {}
+      reportRowHeightChange: () => {}
     })
 
     return (

+ 4 - 1
packages/core/src/scrollgrid/util.tsx

@@ -22,6 +22,7 @@ export interface SectionConfig {
   maxHeight?: number
   vGrow?: boolean
   vGrowRows?: boolean // TODO: how to get a bottom rule?
+  syncRowHeights?: boolean // yuck
 }
 
 export type ChunkConfigContent = (contentProps: ChunkContentCallbackArgs) => VNode
@@ -42,8 +43,9 @@ export interface ChunkContentCallbackArgs { // TODO: util for wrapping tables!?
   clientWidth: CssDimValue
   clientHeight: CssDimValue
   vGrowRows: boolean
+  syncRowHeights: boolean
   rowSyncHeights: number[]
-  requestHeightSync: () => void
+  reportRowHeightChange: (rowEl: HTMLElement, isStable: boolean) => void
 }
 
 
@@ -85,6 +87,7 @@ export function renderChunkContent(sectionConfig: SectionConfig, chunkConfig: Ch
   let content: VNode = typeof chunkConfig.content === 'function' ?
     chunkConfig.content(arg) :
     h('table', {
+      className: sectionConfig.syncRowHeights ? 'fc-scrollgrid-height-sync' : '',
       style: {
         minWidth: arg.tableMinWidth, // because colMinWidths arent enough
         width: arg.clientWidth,