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

Input Field Text - optimize component usage in forms #990

Open
2 of 4 tasks
thrbnhrtmnn opened this issue Mar 7, 2024 · 1 comment
Open
2 of 4 tasks

Input Field Text - optimize component usage in forms #990

thrbnhrtmnn opened this issue Mar 7, 2024 · 1 comment
Labels
🚫 blocked This issue is blocked ⭕ core team issue This is for the core team and should not be done by contributors ⌨️ dev issue Task is for developers 🎓 junior issue Good for juniors
Milestone

Comments

@thrbnhrtmnn
Copy link
Contributor

Description / User story

After doing a first exploration with #596 , we have some open tasks to make the Input Field Text component usable in real forms.

Requirements / Prerequisites

Acceptance Criteria

  • Acceptance Criteria 1
  • ...

Additional information

There are more tasks like this for other form components:

  • ...

Code of Conduct

  • I agree to follow this project's Code of Conduct
@thrbnhrtmnn thrbnhrtmnn added ⌨️ dev issue Task is for developers ⭕ core team issue This is for the core team and should not be done by contributors labels Mar 7, 2024
@angsherpa456
Copy link
Contributor

angsherpa456 commented Mar 7, 2024

Steps taken while exploring #596:

  1. A form component named as BlrForm, created with one slot and submit button.
  2. Two versions of example usage of form created. First version is named as BlrFormExampleWithSlot where the form created in #1 is used. In the second version named BlrFormExampleWithoutslot the form template is directly used.
  3. In the above mentioned example form components namely BlrTextInput, BlrCheckbox and Blrradio button were used.
  4. Mixins named 'testing' was created and used in the BlrTextInput component.The Mixin was required because the property change of slotted BlrTextInput (eg: hasError) did not trigger an update, as the property update was not registered the BlrTextInput did not show any error. Therefore an event was dispatched with the payload of hasError and errorMessage from the slotted form component (BlrTextInput) whenever it is invalid. The implementation can be seen in this experimental PR 'feat(ui-library): forms with&without slot and simple manual validation(#596) #977'

Observation:

  1. BlrRadioGroup did not work out of box. Radio element not rendered only the hint and lable were rendered.
  2. BlrNumberInput also had a reactivity issue with regards to the property change. In other words, it did not work out of box like other components.
  3. BlrCheckbox gets the infinite loop rendering when the checked property is passed. '<blr-checkbox .checked ...>'

Wishful changes for the future:

  1. The submit button can also be slotted rather than placing it inside the form component as in Steps #1. Hint: When the submit button is slotted then there might be an issue with connecting the handleSubmit event, however, a button with role="submit" might already solve the issue.
  2. The form with slotted version will be handy for complex validation later on so it is preffered over the approach where the tag is directly used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚫 blocked This issue is blocked ⭕ core team issue This is for the core team and should not be done by contributors ⌨️ dev issue Task is for developers 🎓 junior issue Good for juniors
Projects
None yet
Development

No branches or pull requests

2 participants