Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.

Checkbox: allow props to be passed via props #438

Closed
moog16 opened this issue Nov 14, 2018 · 5 comments
Closed

Checkbox: allow props to be passed via props #438

moog16 opened this issue Nov 14, 2018 · 5 comments
Labels
Unresolved (Archived) Open and unresolved issues and PRs that were closed due to archiving the repository.

Comments

@moog16
Copy link

moog16 commented Nov 14, 2018

Nov 13 in Discord user reports issues of being able to pass props to field. He created a codepen. JS on the right is the JSX markup. The HTML on the left is what was output by the rendering engine.

https://codepen.io/jbsmith969/pen/zMNVEL

What would be better is rendering the component through composition. Instead of doing:

<Checkbox ... />

we should instead do:

<Checkbox ... >
  <CheckboxInput ... />
</Checkbox>
@moog16 moog16 added this to the 0.7.0 milestone Nov 14, 2018
@behivetech
Copy link

Oh nice! I like that. Would you do same for the Switch component as well?

@moog16
Copy link
Author

moog16 commented Nov 19, 2018

Yes, especially for consistency that makes sense. I'll open one for that component

@moog16
Copy link
Author

moog16 commented Nov 21, 2018

Need to keep in mind this bug when fixing this issue.

@behivetech
Copy link

behivetech commented Nov 21, 2018

From what I'm reading on that bug, it would seem like the ref issue would be fixed with this wouldn't it? The whole point of it is to give the developer more control over the props passed to the input element, so I would think this should come from free with this implementation.

@moog16
Copy link
Author

moog16 commented Nov 21, 2018

This component actually needs a handle on the ref. So it actually won't be fixed for free. But #308 is something we should have available in some way shape or form to give the developer more control. We may need to proxy the ref to the developer. Currently in text field we have a solution:

https://github.com/material-components/material-components-web-react/blob/master/packages/text-field/Input.js#L109

@moog16 moog16 modified the milestones: 0.7.0, 0.8.0 Nov 30, 2018
@bonniezhou bonniezhou modified the milestones: 0.8.0, 0.9.0 Nov 30, 2018
@moog16 moog16 removed this from the 0.9.0 milestone Jan 4, 2019
@bonniezhou bonniezhou removed their assignment Feb 27, 2020
@asyncLiz asyncLiz added the Unresolved (Archived) Open and unresolved issues and PRs that were closed due to archiving the repository. label Jan 14, 2025
@asyncLiz asyncLiz closed this as not planned Won't fix, can't repro, duplicate, stale Jan 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Unresolved (Archived) Open and unresolved issues and PRs that were closed due to archiving the repository.
Projects
None yet
Development

No branches or pull requests

4 participants