You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Setting an uiSchema with "type": "Group" will remove any special character (including accents/diacritics) of the label properties, such as ã, õ, é, -, etc. It also will capitalize every first letter of the sentence:
'this is a test' => 'This Is A Test'
'joão' => 'Joao'
In the screenshots below, you can notice that this does not happen for the Array Renderer. You can notice that the "Destinatários" is formatted accordingly to its label, including the letter 'á'.
To Reproduce
Steps to reproduce the behavior:
Create a regular UiSchema with type being set to "Group";
Use material-renderer (haven't tested with any other);
Add a label to this Group containing any special character, such as ã, õ, é, -, etc;
Check the render;
Expected behavior
I'd expect the label to be exactly the same as the one I typed, without setting any capital letters and removing special characters
Screenshots
Browser:
Chrome
Version 88.0.4324.150
Used Setup:
Framework: React
RendererSet: Material
Additional context
I've made some digging already and found out what is causing this. Inside of the MaterialObjectRenderer, we can find this excert:
startCase is imported from lodash and it does remove any special characters. It looks like startCase does not need to be there. I've modified the code already and a solution would be:
This way is using lodash but I still do not think JsonForms should capitalize the first letters of the label. So an yet better solution (in my opinion) would be:
(detailUiSchema as GroupLayout).label = isPlainLabel(label) ? label : label.default;
Not sure if this workaround won't mess with already existing features, tho'. Shall I make a PR with this fix?
Sorry about my English.
The text was updated successfully, but these errors were encountered:
Hi @sifthedog, thanks for the report and the analysis! You're right, the Group's label is inconsistent with all other ui schema labels. I think this was just an oversight, there is no reason to modify the user given label at all. We usually only do this for implicit labels, for example where no label or title is given and we need to derive the label from the property name.
Therefore I like the last suggestion best. Would be great if you could open a PR :)
Describe the bug
Setting an uiSchema with
"type": "Group"
will remove any special character (including accents/diacritics) of the label properties, such as ã, õ, é, -, etc. It also will capitalize every first letter of the sentence:In the screenshots below, you can notice that this does not happen for the Array Renderer. You can notice that the "Destinatários" is formatted accordingly to its label, including the letter 'á'.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I'd expect the label to be exactly the same as the one I typed, without setting any capital letters and removing special characters
Screenshots


Browser:
Used Setup:
Additional context
I've made some digging already and found out what is causing this. Inside of the MaterialObjectRenderer, we can find this excert:
startCase
is imported from lodash and it does remove any special characters. It looks likestartCase
does not need to be there. I've modified the code already and a solution would be:This way is using lodash but I still do not think JsonForms should capitalize the first letters of the label. So an yet better solution (in my opinion) would be:
Not sure if this workaround won't mess with already existing features, tho'. Shall I make a PR with this fix?
Sorry about my English.
The text was updated successfully, but these errors were encountered: