I am new to Bootstrap 4. I've got a navigation menu with a dropdown item in it. It has the standard Bootstrap caret pointing down, which is automatically added.
Now, I want to change the direction to 'up' after opening the dropdown menu of the nav item. I already searched the whole internet and beyond but couldn't find a working solution for Bootstrap 4 without using font-awesome or workarounds.
Here's my HTML code for the menu (which is working fine), including the dropdown item (Item 2):
<nav class="navbar navbar-expand-sm navbar-light">
<a class="navbar-brand" href="#"><img src="img/logo.svg" width="80" height="80" alt="Logo"></a>
<button type="button" class="navbar-toggler" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div class="collapse navbar-collapse">
<div class="navbar-nav">
<a class="nav-item nav-link active" href="#">Item 1<span class="sr-only">(current)</span></a>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="" data-toggle="dropdown">Item 2</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="#">Item 2.1</a>
<a class="dropdown-item" href="#">Item 2.2</a>
<a class="dropdown-item" href="#">Item 2.3</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">Item 2.4</a>
</div>
</li>
<a class="nav-item nav-link" href="#">Item 3</a>
<a class="nav-item nav-link" href="#">Item 4</a>
</div>
</div>
</nav>
A CSS or jQuery solution would be okay, as long it is not a workaround but a nice, clean Bootstrap solution. Should be possible, right?
So, who can help me out changing the caret direction from down to up when opening the dropdown-item? Eventually with nice animation. Thanks in advance!