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

dropdown , ripples does not work on angular 17 #1535

Open
Kaizodo opened this issue Dec 21, 2023 · 1 comment
Open

dropdown , ripples does not work on angular 17 #1535

Kaizodo opened this issue Dec 21, 2023 · 1 comment

Comments

@Kaizodo
Copy link

Kaizodo commented Dec 21, 2023

i have angular 17 fresh project , when add buttons and dropdowns on index.html everything works fine however when i add same into angular component (or dynamically created content) it seems ripples and dropdowns does not work its like events are bound when all content is loaded. i tested the same with older mdb version 4.x on that only ripples were working again dropdowns were not opening .

this is my index.html file of angular 17 project

index.html

<!doctype html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <title>Angular 17</title>
  <base href="/">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="icon" type="image/png" href="/assets/img/logo/sm.png">
  <link rel="preconnect" href="https://fonts.googleapis.com">
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  <link href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap" rel="stylesheet">
  <link href="/assets/mdb/css/mdb.min.css" rel="stylesheet">
</head>

<body>
  <app-root></app-root>
  <script src="./assets/mdb/js/mdb.umd.min.js"></script>
</body>

</html>

app.component.html
i get no ripple and no dropdown although css does work properly as expected its just javascript which is not working

<div class="dropdown">
  <button
    class="btn btn-primary dropdown-toggle"
    type="button"
    id="dropdownMenuButton"
    data-mdb-dropdown-init
    data-mdb-ripple-init
    aria-expanded="false"
  >
    Dropdown button
  </button>
  <ul class="dropdown-menu" aria-labelledby="dropdownMenuButton">
    <li><a class="dropdown-item" href="#">Action</a></li>
    <li><a class="dropdown-item" href="#">Another action</a></li>
    <li><a class="dropdown-item" href="#">Something else here</a></li>
  </ul>
</div>

i have tested Accordion and its working fine even on dynamically loaded content.

@Shigure92
Copy link
Contributor

We have package dedicated to Angular:
https://github.com/mdbootstrap/mdb-angular-ui-kit

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

2 participants