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

Add inputRef for checkbox #308

Closed
moog16 opened this issue Oct 3, 2018 · 0 comments
Closed

Add inputRef for checkbox #308

moog16 opened this issue Oct 3, 2018 · 0 comments
Labels
bug Something isn't working Unresolved (Archived) Open and unresolved issues and PRs that were closed due to archiving the repository.

Comments

@moog16
Copy link

moog16 commented Oct 3, 2018

NativeControl.js contains an element, which can be focused programatically. Currently there is no way to do that. The best "React" way is to use the ref and call .focus() on the input element.

So far the best solution is to allow for a ref prop and use allow the user to intercept the element.

Currently in NativeControl:

rippleActivatorRef = React.createRef();
... 
<input
        type='checkbox'
        className='mdc-checkbox__native-control'
        ref={rippleActivatorRef}
        {...otherProps}
 />

Potential solution:

rippleActivatorRef = props.rippleActivtorRef || React.createRef();
...
@moog16 moog16 added the bug Something isn't working label Oct 3, 2018
@moog16 moog16 added this to the 0.8.0 milestone Oct 31, 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
@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
bug Something isn't working 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

3 participants