🧐[问题] Suppress `onFinish` Trigger on Value Change in LightFilter
Opened this issue · 1 comments
yuki2006 commented
🧐 问题描述
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
wtcodeai commented
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)