Fix number
field template so it works within Collections.
#3146
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
since v5.1.5, commit #3122 when number field "mode" is "float" (which is by default), the step is "'any'" by default (note the single quote wrapped by the double quote).
This "'any'" value should not be escaped because it breaks when the number field is used within a collection.
For instance, bellow is an extract of an "editor-collection" component generated by the backend when using a collection field having "number" field as child,
we can see it use a :template prop filled with escaped templates of fields members :
Without applying a |raw filter, the value is double encoded and generates :
:step=\"'any'\"
(which decoded is the same as:step=\"'any'\"
instead of
:step=\"'any'\"
(which decoded is the same as:step=\"'any'\"
)This leads to a vue compilation error :
However when using number field directly (ie without a collection field) it's was working.
Using the |raw filter makes it work in both cases.
Note : this regression can lead to data loss when saving broken collections ...