sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

When property pane is in Non-Reactive mode, the validation function should only fire when clicked on "Apply"

Open vman opened this issue 10 years ago • 8 comments

Right now, no matter if in reactive or non-reactive mode, the validation function fires after the delay set in in the deferredValidationTime property (or the default 200 ms if the property is not set)

When in non-reactive mode, if the validation function fired only after the user clicked on "Apply", it would save a lot of unnecessary function calls, especially if the validation function is making an HTTP request somewhere (e.g. talking to SharePoint)

function fire

My code for this is located here if it helps: https://github.com/vman/SPFx-Web-part-property-validator

vman avatar Aug 27 '16 14:08 vman

This should be fixed in Drop 2

patmill avatar Sep 02 '16 20:09 patmill

Looks like the issue is still present in Drop 2. Here is the code I have tried with: https://github.com/vman/Drop-2-Validations

vman avatar Sep 05 '16 13:09 vman

Hello @vman ,

Thanks for the feedback. I understand the problem with validation triggering on every key stroke. We have come up with a new feature which allows the developer to trigger the validation on blur(and also on focus). This new feature will roll out to production soon Here are the two apis validateOnFocusOut and validateOnFocusIn.

Does this suffice your need for now? I know this is not triggering the validation on 'Apply' button click but definitely more helpful. Let us know your opinion.

srideshpande avatar May 08 '17 20:05 srideshpande

Hello, @vman - Since I did not hear anything from you, I am closing the issue now. Please feel free to re-open it if you think the issue needs our further attention.

Thanks!

srideshpande avatar May 11 '17 21:05 srideshpande

Hi @srideshpande sorry I missed your message earlier. Thanks for the reply! I will have a look at it and get back to you on this.

vman avatar May 11 '17 22:05 vman

@srideshpande this works really well now. Great stuff thanks!

vman avatar Jul 18 '17 14:07 vman

@srideshpande I want to prepare some my custom code to manage other activities on apply. Can i do that? anything is available to execute on apply button?

shahjinesh11 avatar Aug 06 '18 09:08 shahjinesh11

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues

msft-github-bot avatar Jan 30 '20 12:01 msft-github-bot