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

Add inputRef for checkbox  #308

Closed as not planned
Closed as not planned
@moog16

Description

@moog16

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();
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Unresolved (Archived)Open and unresolved issues and PRs that were closed due to archiving the repository.bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions