From 434940bae0c920654c465af32d6aedac6247597f Mon Sep 17 00:00:00 2001 From: Bastian Luettig Date: Wed, 24 Jul 2024 16:48:26 +0200 Subject: [PATCH 1/2] fix: return ready event through eventemitter --- src/view/container.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/view/container.tsx b/src/view/container.tsx index 40a5ef98..2b16771b 100644 --- a/src/view/container.tsx +++ b/src/view/container.tsx @@ -38,6 +38,7 @@ export function Container() { }, config.processingThrottleMs); useEffect(() => { + config.eventEmitter.emit('ready'); // set the initial header object // we update the header width later when "data" // is available in the state From 4b0dc924dc9e558cbc93a3034612674797345531 Mon Sep 17 00:00:00 2001 From: Bastian Luettig Date: Thu, 25 Jul 2024 00:22:42 +0200 Subject: [PATCH 2/2] actually correctly fire ready event --- src/view/container.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/view/container.tsx b/src/view/container.tsx index 2b16771b..5aad491f 100644 --- a/src/view/container.tsx +++ b/src/view/container.tsx @@ -38,7 +38,6 @@ export function Container() { }, config.processingThrottleMs); useEffect(() => { - config.eventEmitter.emit('ready'); // set the initial header object // we update the header width later when "data" // is available in the state @@ -54,6 +53,8 @@ export function Container() { if (config.header && status === Status.Loaded && data?.length) { // now that we have the data, let's adjust columns width // NOTE: that we only calculate the columns width once + config.eventEmitter.emit('ready'); + dispatch( actions.SetHeader(config.header.adjustWidth(config, tableRef, tempRef)), );