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

Add Form Component - Radio & Checkbox #86

Closed
nizniz187 opened this issue Aug 5, 2021 · 5 comments
Closed

Add Form Component - Radio & Checkbox #86

nizniz187 opened this issue Aug 5, 2021 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@nizniz187
Copy link
Contributor

Due the similarity of these 2 components, this issue is opened for developing the further common parts.

@nizniz187 nizniz187 self-assigned this Aug 5, 2021
@nizniz187 nizniz187 added the enhancement New feature or request label Aug 5, 2021
@nizniz187 nizniz187 added this to the Form Components milestone Aug 5, 2021
@nizniz187
Copy link
Contributor Author

Add Checkable class as the parent to be extended on commit 2386fb0.

@nizniz187
Copy link
Contributor Author

Fix spacing between icon & slot on commit 7ff5a1d.

@nizniz187
Copy link
Contributor Author

nizniz187 commented Aug 7, 2021

For native form / input feature support such as change handler and form element direct access, the
Customized built-in element is what we need.
However, the Safari browser support (even Chrome on iOS) remains an issue till now on 2021.
image

According to the issue thread, this is closed as WONTFIX and expected to fulfill with a polyfill, which implies that it may remain officially unsupported on Safari/iOS in the near future.

For now, I prefer to use the "standard way", and introduce the polyfill for Safari/iOS users.

@nizniz187
Copy link
Contributor Author

Studied material-components, which extends LitElement as their base element. That said, they don't use customized built-in elements for form elements, but rather extend all from HTMLElement and build their own.

@nizniz187
Copy link
Contributor Author

nizniz187 commented Aug 17, 2021

Customize built-in component (HTMLInputElement) issues:
1. "is" attribute is required

  • UA needs to distinguish between built-in and non-built-in elements. (source)
  • Which will eventually cause inconsistent user experience.

2. "type" attribute needs to be user-specified

  • Which is redundant but without it the construct process will face an initial type problem.
    • Render is executed before the custom type specified.
    • Built-in element cannot assign prototype field.

3. Shadow DOM is not supported for input & label

Due to the issues above, we may need to re-consider using customized built-in elements for Form Components.

nizniz187 added a commit that referenced this issue Aug 24, 2021
nizniz187 added a commit that referenced this issue Aug 30, 2021
nizniz187 added a commit that referenced this issue Sep 5, 2021
nizniz187 added a commit that referenced this issue Sep 5, 2021
nizniz187 added a commit that referenced this issue Sep 12, 2021
@cwpeng cwpeng closed this as completed Sep 14, 2021
@nizniz187 nizniz187 reopened this Sep 15, 2021
@yakkowu yakkowu self-assigned this Feb 9, 2022
@yakkowu yakkowu added ui/ux UI/UX design and removed ui/ux UI/UX design labels Feb 9, 2022
@yakkowu yakkowu removed their assignment Feb 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants