Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add configurable id to Autocomplete Result items <li/> #363

Closed
Ibabalola opened this issue Dec 2, 2022 · 1 comment · Fixed by #364
Closed

Add configurable id to Autocomplete Result items <li/> #363

Ibabalola opened this issue Dec 2, 2022 · 1 comment · Fixed by #364
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@Ibabalola
Copy link
Contributor

Is your feature request related to a problem? Please describe.
On the there needs to be a way of adding an id to each

  • within the
      so that each item within the list can be identified.

      Describe the solution you'd like

                <li
                  id={`${liContainerId}--${index}`} // <--- THIS IS WHAT IS NEEDED
                  className={
                    index === activeOption && activeClass
                      ? [activeClass, liContainerClass].join(' ')
                      : [
                          liContainerClass,
                          index % 2 === 0
                            ? `${liContainerClass}--even`
                            : `${liContainerClass}--odd`,
                        ].join(' ')
                  }
                  key={optionName}
                  onClick={onClick}
                  style={liContainerStyle}
                >
                  {optionName}
                </li>

      Additional context
      Specie list - id="species_option--0"; id="species_option--1"...etc
      Product favorite Page
      Add product from favorite list - id="product_option--0"; id="product_option--1"...etc.... when we have at least one product in the favorite list

  • @Ibabalola Ibabalola added the enhancement New feature or request label Dec 2, 2022
    @Ibabalola Ibabalola added this to the 0.6 milestone Dec 2, 2022
    @daniele-zurico
    Copy link
    Contributor

    PR created: #364

    @daniele-zurico daniele-zurico self-assigned this Dec 3, 2022
    @Ibabalola Ibabalola linked a pull request Dec 3, 2022 that will close this issue
    # for free to join this conversation on GitHub. Already have an account? # to comment
    Labels
    enhancement New feature or request
    Projects
    None yet
    Development

    Successfully merging a pull request may close this issue.

    2 participants