Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Create and initialise default ref prop for Startdust components #417

Closed
@silviuaavram

Description

@silviuaavram

Feature Request

Create default ref for Startdust components that should point to the first DOM Element in the renderComponent.

Problem description

While developing the Dropdown component and using other Stardust components, I've used Input and List and had to manually expose refs for those components in order to use them in the Dropdown implementation (input focus, list passed to Downshift).

Proposed solution

A default ref prop should be added for each component probably in the renderComponent and initialised with the first DOMElement from the render function. (the List should've had the ElementType <ul>).

This ref prop should also be easy to override in case we want custom behaviour.

This default ref prop should not impact the addition of other ref-like props. For instance, in Input, we can still have the inputRef pointing to the <input> and the default ref pointing to the <div> enclosing it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    vstsPaired with ticket in vsts⚙️ enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions