There is any solution/workaround to avoid presubmit on unchanged cell values?

There is any solution/workaround to avoid presubmit on unchanged cell values?

GoinsideGoinside Posts: 11Questions: 3Answers: 0

Hello!

I am having trouble switching between columns via tab key. When I switch, the presubmit is triggered even when i don't change any of the cell values.

While I was searching for a reason, I found this comment (at Editor.prototype._edit):

            // Save the set data values so we can decided in submit if data has changed
            // Note that `null` is stored as an empty string since fields do not currently
            // have the ability to store a null value - when they are read back (in the
            // submit) they would be an empty string. When null handling is added to
            // fields, this will need to be removed.
            editData[ name ][ idSrc ] = val === null ?
                '' :
                Array.isArray(val) ?
                    val.slice() :
                    val;

Later (at Editor.prototype._submit) there is a check for changed values, the thing is that null values are consired empty values, considering the comment before.

I would like to know if there is any alredy expected workaround for this situation or one possible future resolution.
Any additional tips are welcome :)

Much appreciated.

Answers

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin

    We do that null value check and change since Editor will read the value of the form elements back from the input elements. That effectively casts them as a string - hence this requirement.

    As such, I don't quite understand where the null value is coming from at the point of submission. Could you give me a link to your page so I can trace it through please?

    Thanks,
    Allan

Sign In or Register to comment.