materialize
materialize copied to clipboard
Click on the icon in dropdown does not open dropdown menu
Description
When dropdown trigger is created as a button with icon, click on an icon does not open dropdown menu.
Repro Steps
- Create a dropdown structure as described in spec:
<!-- Dropdown Structure -->
<ul id='dropdown1' class='dropdown-content'>
<li><a href="#!">one</a></li>
<li><a href="#!">two</a></li>
<li class="divider"></li>
<li><a href="#!">three</a></li>
<li><a href="#!"><i class="material-icons">view_module</i>four</a></li>
<li><a href="#!"><i class="material-icons">cloud</i>five</a></li>
</ul>
- Add dropdown trigger as a button with icon:
<!-- Dropdown Trigger -->
<a class='dropdown-button btn' href='#' data-activates='dropdown1'><i class="material-icons right">arrow_drop_down</i>Drop Me!</a>
- Initialize dropdown:
$('.dropdown-button').dropdown({
inDuration: 300,
outDuration: 225,
constrainWidth: false, // Does not change width of dropdown to that of the activator
hover: true, // Activate on hover
gutter: 0, // Spacing from edge
belowOrigin: false, // Displays dropdown below the button
alignment: 'left', // Displays dropdown with edge aligned to the left of button
stopPropagation: false // Stops event propagation
}
);
- Click on the icon.
Expected: dropdown is open
Result: nothing happens. Only if you click on
Drop Me!text dropdown will be opened.
This should be fixed in v0.98.2
https://github.com/Dogfalo/materialize/issues/4409
@tomscholz Thank you!