Skip to content

PropTypes check for children #6

@kristian-puccio

Description

@kristian-puccio

I guess we need to do this check so we don't try to focus a non-form element:
if (child.type.propTypes && child.type.propTypes.value && child.type.propTypes.valid) {

Just I don't use propTypes as I'm using typescript.
So I propose we do this another way:
if (typeof child.props.value !== 'undefined') {

That way the presence of the value property (with value or not) is enough.

I guess another way of doing this is to have a 'isSelectable' prop.

Let me know what you think and I'll prepare a pull-request

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions