Clicking on the dropdown icon will generate multiple hits to the server (when no results are returned).
Clicking on the dropdown icon will generate multiple hits to the server (when no results are returned).
HTML
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.10/semantic.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.10/semantic.min.js"></script>
<p>
Open the console log below. Click once directly on the dropdown <i class="dropdown icon"></i> icon and the api will fire more than once when 0 results returned. (too much recursion)
</p>
<div class="ui form">
<div class="field">
<label>Favorite Animal</label>
<div class="ui search selection dropdown">
<input type="hidden">
<i class="dropdown icon"></i>
<input type="text" class="search" tabindex="0">
<div class="default text">Select one...</div>
<div class="menu" tabindex="-1"></div>
</div>
</div>
</div>
CSS
body {
margin: 10px;
}
JavaScript
//$.fn.dropdown.settings.forceSelection = false;
$('.ui.dropdown').dropdown({
apiSettings: {
url: '//api.semantic-ui.com/tags',
cache: false
}
});