Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typeUserAttrs checkbox label does not use i18n value #1391

Closed
mtthwprtchrd opened this issue Aug 16, 2023 · 3 comments · Fixed by #1392
Closed

typeUserAttrs checkbox label does not use i18n value #1391

mtthwprtchrd opened this issue Aug 16, 2023 · 3 comments · Fixed by #1392

Comments

@mtthwprtchrd
Copy link

mtthwprtchrd commented Aug 16, 2023

Description:

When adding a readonly checkbox attribute to a text field the label does not use the value specified in the i18n structure whereas the name attribute of a text field will use the i18n value.

Environment Details:

  • formBuilder Version: 3.8.2
  • Browser: Chrome 115.0.5790.171 (Official Build) (64-bit)
  • OS: Windows 10

Expected Behavior

A typeUserAttrs checkbox sub-type should retrieve it's label from the i18n structure.

Actual Behavior

A typeUserAttrs checkbox sub-type retrieves it's label from the i18n structure.

Steps to Reproduce

Single page repro.

Drag a text field onto the form builder
Edit the component
The name attribute is renamed to Field Id from the i18n structure
The Read-only field takes its label from the attribute name instead of the i18n structure.

See this code pen https://codepen.io/Matthew-Pritchard/pen/KKbPbxQ for a repro of the problem (adapted from the original i18n sample https://codepen.io/kevinchappell/pen/EMqvbG)

Screenshot - (optional)

@lucasnetau
Copy link
Collaborator

Hi @mtthwprtchrd please give PR #1392 a go, it should resolve your issue.

Also note that in your codepen type: 'check-box' should be type: 'checkbox' without the hyphen

@mtthwprtchrd
Copy link
Author

mtthwprtchrd commented Aug 22, 2023

Hi @lucasnetau Thank you very much for the quick response. Your PR #1392 resolves my issue.

Thanks, the "check-box" was just a typo.

I found another somewhat related issue but I've raised a separate item for that #1394.

github-actions bot pushed a commit that referenced this issue Sep 12, 2023
## [3.9.11](v3.9.10...v3.9.11) (2023-09-12)

### Bug Fixes

* i18n is a straight key/value pair, it does not contain a get() function ([ebe59ce](ebe59ce))
* If no value was set for a numberAttribute the value attribute's value was used instead. This causes min/max/step/rows/maxLen number attributes to incorrectly be assigned a value if they are not set in formData but a number exists in the value attribute ([28b1a6f](28b1a6f))
* Use the i18n translated label for boolean typeUserAttrs. Fixes [#1391](#1391) ([bc04612](bc04612))
@github-actions
Copy link

🎉 This issue has been resolved in version 3.9.11 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants