question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Dropdown] Search dropdowns don't hide dividers

See original GitHub issue

Here is a standard ui search selection dropdown in Semantic UI v2.3:

screen-shot-2018-02-20-at-12 55 37 amb

Take note of the dividers (such as the one above “Other”.

Now observe what happens after entering pote in search:

screen shot 2018-02-20 at 12 56 43 am

See how the two dividers are still there below “Potential Employee”? This gets pretty gnarly with larger lists.

I’d suggest hiding .ui.search.selection.dropdown > .menu > .divider via javascript whenever search is triggered, and un-hiding them when it’s empty.

HTML:

<div class="field">
  <label>Phone Type</label>
  <div class="ui search selection dropdown">
    <input type="hidden" name="type_id">
    <i class="dropdown icon"></i>
    <div class="default text">Phone Type</div>
    <div class="menu">
      <div class="item" data-value="1">Sales Lead</div>
      <div class="item" data-value="2">Distributor</div>
      <div class="item" data-value="3">Potential Distributor</div>
      <div class="item" data-value="4">Postal</div>
      <div class="item" data-value="5">Freight</div>
      <div class="item" data-value="6">Maintenance</div>
      <div class="item" data-value="7">Potential Employee</div>
      <div class="divider"></div>
      <div class="item" data-value="8">Family</div>
      <div class="item" data-value="9">Friend</div>
      <div class="item" data-value="10">Douchebag</div>
      <div class="divider"></div>
      <div class="item" data-value="1000">Other</div>
    </div>
  </div>
</div>

JS:

$('.ui.search.selection.dropdown').dropdown({
  // true, false and 'exact' all have this issue
  fullTextSearch: 'exact'
});

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
lubber-decommented, Oct 6, 2022
1reaction
designosiscommented, May 22, 2018

Bump.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Don't hide dropdown list when clicked inside it - Stack Overflow
I've made this dropdown menu using bootstrap. The problem is that it hides itself when I click inside it or check a checkbox...
Read more >
Dropdown - Semantic UI
A selection dropdown can allow a user to search through a large list of choices. ... A dropdown menu can contain dividers to...
Read more >
Excel - automatically hiding select rows based on drop down ...
Hi there! I have a drop down selection of 10 items on my dashboard tab and am trying to only show rows 57...
Read more >
Bootstrap Dropdowns - examples & tutorial
Responsive dropdown/caret built with Bootstrap 5. Examples of navbar dropdown, dropdown list, submenu, dropdown toggle, dropdown hover, hamburger icon ...
Read more >
Dropdowns · Bootstrap v5.0
Wrap the dropdown's toggle (your button or link) and the dropdown menu within .dropdown , or another element that declares position: relative; ....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found