Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

bootstrap v5 alpha - "accordion" js is not working, bootstrap v5 beta yes #32656

Closed
ShlomiRex opened this issue Jan 2, 2021 · 3 comments
Closed

Comments

@ShlomiRex
Copy link

ShlomiRex commented Jan 2, 2021

Windows 10, Chrome

Is it just me?

Code:

<div class="accordion" id="accordionExample2">
	<div class="accordion-item">
		<h2 class="accordion-header" id="headingOne">
			<button class="accordion-button" type="button" data-bs-toggle="collapse"
				data-bs-target="#collapseTwo" aria-expanded="true" aria-controls="collapseTwo">
				Accordion Item #1
			</button>
		</h2>
		<div id="collapseTwo" class="accordion-collapse collapse show"
			aria-labelledby="headingOne" data-bs-parent="#accordionExample2">
			<div class="accordion-body">


				<div class="list-group" id="list-tab" role="tablist">
					<a class="list-group-item list-group-item-action active" id="list-home-list"
						data-toggle="list" href="#list-home" role="tab"
						aria-controls="home">Home</a>
					<a class="list-group-item list-group-item-action" id="list-profile-list"
						data-toggle="list" href="#list-profile" role="tab"
						aria-controls="profile">Profile</a>
					<a class="list-group-item list-group-item-action" id="list-messages-list"
						data-toggle="list" href="#list-messages" role="tab"
						aria-controls="messages">Messages</a>
					<a class="list-group-item list-group-item-action" id="list-settings-list"
						data-toggle="list" href="#list-settings" role="tab"
						aria-controls="settings">Settings</a>
				</div>


			</div>
		</div>
	</div>
</div>

It's quite a bummer, because of:
#32655

There I must use alpha 1 instead of beta 1 because list-group activation js code is not working
But in this can I need to use beta 1
So I need to use both alpha and beta for accordion and list-group active

@Andres6936
Copy link

In Bootstrap v5.0.0-beta1 the follow message is showed for MS Edge:

Uncaught TypeError: _this._getConfig is not a function
    at Object.Carousel (carousel.js:123)
    at (index):302
Carousel @ carousel.js:123
(anonymous) @ (index):302

@mdo
Copy link
Member

mdo commented Jan 7, 2021

data-toggle is now data-bs-toggle. Check your markup, we had a breaking change to namespace data attributes.

@mdo mdo closed this as completed Jan 7, 2021
@huzaifaamir
Copy link

huzaifaamir commented Jan 18, 2022

Same issue my code is below

<div class="accordion-item">
    <h2 class="accordion-header" id="headingOne">
      <button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
        Accordion Item #1
      </button>
    </h2>
    <div id="collapseOne" class="accordion-collapse collapse show" aria-labelledby="headingOne" data-bs-parent="#accordionExample">
      <div class="accordion-body">
        <strong>This is the first item's accordion body.</strong> It is shown by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the <code>.accordion-body</code>, though the transition does limit overflow.
      </div>
    </div>
  </div>
  <div class="accordion-item">
    <h2 class="accordion-header" id="headingTwo">
      <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseTwo" aria-expanded="false" aria-controls
```="collapseTwo">
        Accordion Item #2
      </button>
    </h2>
    <div id="collapseTwo" class="accordion-collapse collapse" aria-labelledby="headingTwo" `data-bs-parent="#accordionExample">`
      <div class="accordion-body">
        <strong>This is the second item's accordion body.</strong> It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the <code>.accordion-body</code>, though the transition does limit overflow.
      </div>
    </div>
  </div>
  <div class="accordion-item">
    <h2 class="accordion-header" id="headingThree">
      <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
        Accordion Item #3
      </button>
    </h2>
    <div id="collapseThree" class="accordion-collapse collapse" aria-labelledby="headingThree" data-bs-parent="#accordionExample">
      <div class="accordion-body">
        <strong>This is the third item's accordion body.</strong> It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the <code>.accordion-body</code>, though the transition does limit overflow.
      </div>
    </div>
  </div>
</div>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants