question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Prevent initial error spam for required attributes

See original GitHub issue

I have a form with 20 or so questions, all are required. When it is created, there is a red spam that all questions are missing. If option "show_errors": "never" is set, all disappear after single one is edited.

How can I prevent this spam ? I want error to show on field change without initial spam:

Here is the gif showing 3 required questions that disappear as soon first is edited. json

As a side note, this div should probably have some class errors to be easily moved with selectors. Currently the one must get it by position which may be flaky.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:8

github_iconTop GitHub Comments

1reaction
schmunk42commented, Jul 14, 2021

PRs (with test) welcome 😉

0reactions
chandanbncommented, Aug 11, 2021

Not deleting the required empty properties here: https://github.com/json-editor/json-editor/blob/master/src/editors/object.js#L1090 seems to do the trick.

replace

if (isEmpty(result[key])) {

with

if (isEmpty(result[key]) && !(Array.isArray(this.schema.required)) && this.schema.required.includes(key)) {

I feel changing any option should not make JSON output invalid (wrt schema), if it was valid before setting that option.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Anti-spam message headers - Office 365 - Microsoft Learn
In all Microsoft 365 organizations, Exchange Online Protection (EOP) scans all incoming messages for spam, malware, and other threats.
Read more >
Spam responses from website contact form bypassing ...
One way to prevent spam is Honeypot technique, it is proven to work and prevented more than 90% of spam for my company's...
Read more >
Common validation errors when creating issue forms
Common validation errors when creating issue forms · In this article · Required top level key name is missing · key must be...
Read more >
Configuring Spam Scanning Definitions and Policies
If the sender is legitimate, they must re-transmit the message once the spam checks have been bypassed.
Read more >
[Email Protection (PPS/PoD)] Spam Detection
The MLX Engine then utilizes the message's detected attributes and the appropriate classifiers to calculate the probability that the message is spam. This...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found