Skip to content

ListGroup.Item no longer getting the "active" class when active in 2.0.0-beta.5 #6001

Closed
@ishields

Description

@ishields

Describe the bug

Between versions 2.0.0-beta.4 and 2.0.0-beta.5, the behavior of defaultActiveId seems broken. When used correctly, the attribute should render an "active" class on the active ListGroup.Item. This no longer appears to be the case.

To Reproduce

In version versions 2.0.0-beta.4:

<ListGroup defaultActiveKey="#link1">
  <ListGroup.Item action href="#link1">
    Link 1
  </ListGroup.Item>
  <ListGroup.Item action href="#link2" disabled>
    Link 2
  </ListGroup.Item>
  <ListGroup.Item action>This one is a button</ListGroup.Item>
</ListGroup>

will render the following html:
image

Now switch to version 2.0.0-beta.5 (or 2.0.0-beta.6):

The same code renders the following html:
image

The "active" class is missing from the rendered html and as a result the styles are not correct.

Reproducible Example

versions 2.0.0-beta.4
https://codesandbox.io/s/shy-wildflower-x84k4?file=/src/App.js

Version 2.0.0-beta.5 (or 2.0.0-beta.6)
https://codesandbox.io/s/young-tree-8rxh0?file=/src/App.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions