I have a lit-element component that renders the bootstrap dropdown correctly, however when clicking on the dropdown, the menu does not appear. I realize that this is a javascript problem, however I am unclear how to resolve the issue. I am importing the bootstrap bundle js in my index.html file. I am linking to the bootstrap css in the component.
Inside my index.html file I have
<script src="node_modules/jquery/dist/jquery.min.js"></script>
<script defer src="node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
Inside the render of my lit-element component I have
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
Again, the css is recognized since everything renders correctly. The issue is related to the action of dropping the menu down.
Updated to include component code per comment request:
import { html } from 'lit-element';
import { PageViewElement } from './page-view-element.js';
import { connect } from 'pwa-helpers/connect-mixin.js';
// This element is connected to the Redux store.
import { store } from '../store.js';
// These are the actions needed by this element.
import { increment, decrement } from '../actions/counter.js';
import '@polymer/paper-input/paper-input.js'
import '@polymer/paper-dropdown-menu/paper-dropdown-menu.js';
import '@polymer/paper-item/paper-item.js';
import '@polymer/paper-listbox/paper-listbox.js';
// These are the shared styles needed by this element.
import { SharedStyles } from './shared-styles.js';
class MyComponent extends connect(store)(PageViewElement) {
static get properties() {
return {
};
}
constructor() {
super();
}
static get styles() {
return [
SharedStyles
];
}
firstUpdated(){}
render() {
return html`
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<section>
<form onsubmit="return false">
<div class="form-row">
<div class="form-group col-sm-4">
<div class="input-group mb-3">
<input id=“my-input“ type="text" class="form-control">
</div>
</div>
<div class="form-row">
<div class="dropdown">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Dropdown button
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<a class="dropdown-item" href="#">Something else here</a>
</div>
</div>
</div>
</form>
</section>
<section>
</section>
`;
}
}
window.customElements.define('my-component', MyComponent);
Any help would be appreciated.