From a41cb0c2faf8aad0dcd867387237bb44b328105f Mon Sep 17 00:00:00 2001 From: Ben Forshey Date: Thu, 23 Jan 2025 15:07:37 -0500 Subject: [PATCH] fix(rjsf): remove debounce --- .../components/jsonschemaform/jsonschemaform.tsx | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/packages/app/components/jsonschemaform/jsonschemaform.tsx b/packages/app/components/jsonschemaform/jsonschemaform.tsx index 900847302..69e69c058 100644 --- a/packages/app/components/jsonschemaform/jsonschemaform.tsx +++ b/packages/app/components/jsonschemaform/jsonschemaform.tsx @@ -65,16 +65,6 @@ class LargeModelForm< } } - static debounce(fn: Function, delay = 600) { - let timerId: NodeJS.Timeout - - return (...args: any[]) => { - globalThis.clearTimeout(timerId) - - timerId = setTimeout(() => fn(...args), delay) - } - } - /* * Targeting only nodes in our allowlist, we conditionally stop propagation so that the ajv8 validator does not get triggered. * We state lock the event so that later logic does not propagate its change event. @@ -108,9 +98,8 @@ class LargeModelForm< * Targeting only nodes in our allowlist, we check to make sure node's event has been stored. * Because the ajv8 validator is slow on large schemas, we wait until the `blur` event before triggering an update. * We mark the node as ready to propagate, re-dispatching the event. - * Debounce this handler for rapid tabbing, which triggers unnecessary state updates. */ - handleBlur = LargeModelForm.debounce((event: any) => { + handleBlur = (event: any) => { if ( this.targetNodeNames.includes(event.target.nodeName) && this.eventStore[event.target.id] @@ -121,7 +110,7 @@ class LargeModelForm< this.eventStore[event.target.id] ) } - }) + } } const JsonSchemaForm = ({