pro-components icon indicating copy to clipboard operation
pro-components copied to clipboard

🧐[问题] Suppress `onFinish` Trigger on Value Change in LightFilter

Open yuki2006 opened this issue 1 year ago • 1 comments

🧐 问题描述

In the LightFilter component, the onFinish method is being triggered every time a value changes. I am looking for a way to suppress this behavior as we might be adding a separate submit button.

💻 示例代码

This issue can be reproduced in the following demo: Lightweight Filtering Demo

🚑 其他信息

It appears that the submit action is directly invoked in the code here: LightFilter index.tsx - Line 304

yuki2006 avatar May 02 '24 11:05 yuki2006

Think that's the point of Light Filter - any changes will be applied every time state changed. You can easily override this behavior by writing an external hook which uses two states for actual and applied state and can handle submit (or implementing directly in your component)

wtcodeai avatar May 02 '24 16:05 wtcodeai