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